Skip to main content
Inspiring
September 23, 2009
Question

cfchart help

  • September 23, 2009
  • 1 reply
  • 2590 views

I need to graph on y-axsis (Day 1-Day31 of month) on the x-axsis the code of metrics...and their progresses...

Lets say, a metric called "AHT" has the max data till 14 th of the month so the graph bar will be till 14th of the month...

Any help appreciated....

<cfquery name="GetChartData" datasource="#application.DSN_ORC#">
  SELECT   MAX( s.end_date ) AS enddate, m.sc_metric_code as metriccode
    FROM ops$rms.resource_score s, ops$rms.ref_metric m
    WHERE s.metric_code = m.metric_code
     AND EXTRACT( MONTH FROM s.end_date ) = '#Form.Month#'
     AND EXTRACT( YEAR FROM s.end_date ) = '#Form.Year#'
  GROUP BY s.end_date, m.sc_metric_code
</cfquery>

   <cfchart
     format="png"
     xaxistitle="Progress"
     yaxistitle="Date"
     chartheight="400"
     chartwidth="700"
     foregroundcolor="FFFAFA"
     backgroundcolor="BC8F8F"
     fontbold="yes"
     show3d="yes"
     databackgroundcolor="DDA0DD"
     font="Verdana"
     fontsize="13"
     showxgridlines="no"
     showygridlines="yes"
     labelformat="date"
     >
     <cfchartseries
       type="bar"
       seriescolor="8B4513"
      paintstyle="light" query="GetChartData"  itemcolumn="metriccode"  valuecolumn="EndDate" 
       >

     </cfchartseries>
   </cfchart>

This topic has been closed for replies.

1 reply

Inspiring
September 23, 2009

I need to graph on y-axsis (Day 1-Day31 of month) on the x-axsis the code of metrics...and their progresses...

Lets say, a metric called "AHT" has the max data till 14 th of the month so the graph bar will be till 14th of the month...

Any help appreciated...

What is the actual question here?  You've got the "I am trying to do this..." part down.  But there's not "and [something has happened which I did not expect]" part seems to be missing...

--

Adam

emmim44Author
Inspiring
September 24, 2009

Please see the attached image... It doesnt do what I need... I need some guidance..

Inspiring
September 25, 2009

OK.  One thing to consider here is that <cfchart> can only handle numbers for values, not dates.  Now, while a date will be cast to a number, it's not probably going to be the sort of number you want reflected here.

I suspect you'd get the sort of results you are after if you just chart the value of the day of the month (which will be your 1-31), rather than the actual date.

So basically you want your record set to have a row for each metric and a day-of-month value, and chart that.

Nice colour scheme on that chart, btw ;-)

--

Adam