?
Solved

CFchart simple line

Posted on 2012-12-26
3
Medium Priority
?
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
stu215 earned 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

764 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