troubleshooting Question

coldfusion graphing help

Avatar of cseink
cseink asked on
Web Development SoftwareColdFusion Language
4 Comments2 Solutions305 ViewsLast Modified:
I want to graph this data but am unfamiliar with cfml graphing. X-AXIS would be [ED DOOR DT] AND y-axis would be a integer. The line data is CT30,CT60,CT90,CT120,CT120 PLUS FOR EACH DAY.  


code so far..
<!-- Get the raw data from the database. -->
<!-- cfset getdate1 = FORM.one  -->
<!-- cfset getdate2 = FORM.two > -->


<cfquery name="GetSpace" datasource="EDSTATS">
SELECT     (SELECT     COUNT(*)
                       FROM          edstats
                       WHERE      [ED DOOR DT] <> '' AND [trans to flr dt] <> '' AND datediff(mi, [dbo].ConvertToDateTime([ED DOOR DT], [ED DOOR TM]),
                                              [dbo].ConvertToDateTime([TRANS TO FLR DT], [TRANS TO FLR TM])) < 30) AS ct30,
                          (SELECT   COUNT(*)
                            FROM          edstats
                            WHERE      [ED DOOR DT] <> '' AND [trans to flr dt] <> '' AND datediff(mi, [dbo].ConvertToDateTime([ED DOOR DT], [ED DOOR TM]),
                                                   [dbo].ConvertToDateTime([TRANS TO FLR DT], [TRANS TO FLR TM])) BETWEEN 30 AND 60) AS ct60,
                          (SELECT    COUNT(*)
                            FROM          edstats
                            WHERE      [ED DOOR DT] <> '' AND [trans to flr dt] <> '' AND datediff(mi, [dbo].ConvertToDateTime([ED DOOR DT], [ED DOOR TM]),
                                                   [dbo].ConvertToDateTime([TRANS TO FLR DT], [TRANS TO FLR TM])) BETWEEN 60 AND 90) AS ct90,
                          (SELECT    COUNT(*)
                            FROM          edstats
                            WHERE      [ED DOOR DT] <> '' AND [trans to flr dt] <> '' AND datediff(mi, [dbo].ConvertToDateTime([ED DOOR DT], [ED DOOR TM]),
                                                   [dbo].ConvertToDateTime([TRANS TO FLR DT], [TRANS TO FLR TM])) BETWEEN 90 AND 120) AS ct120,
                          (SELECT     COUNT(*)
                            FROM          edstats
                            WHERE      [ED DOOR DT] <> '' AND [trans to flr dt] <> '' AND datediff(mi, [dbo].ConvertToDateTime([ED DOOR DT], [ED DOOR TM]),
                                                   [dbo].ConvertToDateTime([TRANS TO FLR DT], [TRANS TO FLR TM])) > 120) AS ct120plus

</cfquery>






<html>
<head>
   <title>charts</title>
</head>

<body>
<h1>ed gRAPHS </h1>

<!--- Line chart--->

<cfset variables.colorList = "red,green,blue,yellow,black,##ff9900,##ccff00,##999999,##FF00FF,##CC99FF,##666633,##99ccff,##F9D031,##800040,##336600">  <!---- list your colors ---->

<cfchart
      xAxisTitle="Date"
      yAxisTitle="#"
       chartHeight = "500"    
       chartWidth = "500"
     scaleto="100"
      font="Arial"
      gridlines="10"
      showXGridlines="yes"
      showYGridlines="yes"
      showborder="no"
      show3d="no"
     showlegend="yes"
     sortxaxis="yes"
     showmarkers="yes"
format="jpg"




<cfoutput query="GETspace" group="[ed door dt]">

     <cfset variables.thisColor = listFirst(variables.colorList)>
     <cfset variables.colorList = listRest(variables.colorList)>

  <cfchartseries


    type="LINE"
    seriesColor="#variables.thisColor#"
    paintStyle="plain"
    seriesLabel="#getspace.CT120#">

    <cfoutput>
     
 <cfchartdata item="" value="">
    </cfoutput>


  </cfchartseries>

</cfoutput>
 
</cfchart>



<br>
</body>
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros