Solved

CFchart simple line

Posted on 2012-12-26
3
231 Views
Last Modified: 2013-07-23
Edit: I figured out why it's duplicating. <cfchartseries type="line"
    query="GetJITmemberData"


This is my first attempt at cfchart.  It's a simple line chart that show the number of members since inception. The first problem is the chart seems to run twice.  The first part seems ok. The second part seems to chart without dates along the bottom and no aggregate number of members.  The second part is figuring out how to fill in the missing dates so the chart will be balanced and scale at the first day of each month.

<!--- Get the raw data from the database. --->
<cfquery name="GetJITmemberData" datasource="#request.dsn#">
      select  CONVERT(VARCHAR(10),signup_date,111) as sdate, count(id) as idcount
      from signup_temp as s
      where isnull(s.userid,0) > 0
      and entry_point = 10
      and left(s.signup_date,10) > ''
      <!---and s.signup_date between '2012/04/13' and '2012/07/23'--->
      group by CONVERT(VARCHAR(10),signup_date,111)
      order by sdate
</cfquery>

<cfchart format="flash" title="Rate of JobsInTax member growth since launch"
    xaxistitle="Date"
          yaxistitle="Number of Members"
                   chartHeight="600"
                         chartwidth="950"
                               gridlines="7"
                                     labelformat="number"
                                           xaxistype="category"
                                                 scalefrom="0"
                                                       scaleto="300"  
                                                             fontsize="14" >

<cfchartseries type="line"
    query="GetJITmemberData"
    itemcolumn="signup_date"
    valuecolumn="idcount">
      
<cfset membercount = "0">
<cfloop query="GetJITmemberData" >      
      <cfchartdata item="#GetJITmemberData.sdate#" value="#membercount#">
      <cfset membercount = "#val(GetJITmemberData.idcount)#" + "#membercount#">
</cfloop>

</cfchartseries>
</cfchart>


The data is;

2012/04/20      7
2012/04/23      1
2012/04/25      1
2012/04/26      2
2012/04/27      1
2012/04/30      2
2012/05/01      1
2012/05/02      1
2012/05/03      1
2012/05/06      1
2012/05/07      1
2012/05/08      1
2012/05/09      5
2012/05/12      2
2012/05/15      1
2012/05/23      1
2012/05/24      1
2012/05/25      1
2012/05/28      1
2012/05/29      1
2012/05/31      1
2012/06/01      1
2012/06/03      2
2012/06/05      1
2012/06/07      3
2012/06/08      2
2012/06/11      4
2012/06/12      1
2012/06/13      3
2012/06/14      2
2012/06/15      2
2012/06/18      1
2012/06/19      2
2012/06/25      1
2012/06/27      2
2012/06/29      1
2012/06/30      1
2012/07/10      1
2012/07/12      2
2012/07/13      5
2012/07/15      1
2012/07/16      1
2012/07/17      2
2012/07/18      7
2012/07/20      2
2012/07/21      1
2012/07/23      1
2012/07/25      1
2012/07/26      1
2012/07/27      2
2012/07/28      1
2012/07/30      3
2012/07/31      2
2012/08/01      2
0
Comment
Question by:lantervj
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
stu215 earned 500 total points
Comment Utility
Is there another loop surrounding the whole thing causing it to run 2x?

Maybe check the data coming out of your query?
( I believe this function is only available in coldfusion v8 and higher )

Place this after your query:

<cfdump var="#GetJITmemberData#">
0
 

Author Comment

by:lantervj
Comment Utility
Someone else has taken over this problem.  Sorry for my delay.
0
 

Author Closing Comment

by:lantervj
Comment Utility
It turned out that this was the solution.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now