Solved

CFchart simple line

Posted on 2012-12-26
3
233 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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