Solved

CFchart simple line

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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

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…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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