Solved

CFchart simple line

Posted on 2012-12-26
3
235 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
ID: 38752604
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
ID: 38807032
Someone else has taken over this problem.  Sorry for my delay.
0
 

Author Closing Comment

by:lantervj
ID: 39349648
It turned out that this was the solution.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…

726 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