2 Replies Latest reply on Sep 11, 2009 4:36 PM by Adam Cameron.

    Time Values In CFChart

    weggers Level 1
      Hi,

      Is there any way to create a chart using time values for the series?
      For example I have a query that calculates the average time a user has spent on technical help calls in a month. The query works fine.

      I want to display the results of the query in a bar chart.The chart does not work, it wont accept time values.
      Is there a way to convert the time values to simple numbers maybe either in the query or using a function?
      The time format is hh:mm:ss
      Im using MySQL 5.

      QUERY :-

      <cfquery name="avgduration" datasource="datasource">
      SELECT userid, SEC_TO_TIME(AVG(TIME_TO_SEC(TIMEDIFF(closedtime,opentime)))) AS average
      FROM datasource
      WHERE opendate BETWEEN '2009-02-01' AND '2009-02-28' AND loginname = 'userid'
      GROUP BY userid
      </cfquery>

      CHART :-

      <cfchart format="png"
      chartheight="300"
      chartwidth="450"
      showxgridlines="yes"
      showygridlines="yes"
      xaxistitle="Operators"
      yaxistitle="AVG Call Duration"
      title="AVG Call Duraration By Operator">

      <cfchartseries type="bar"
      datalabelstyle="value"
      query="avgduration"
      itemcolumn=""
      valuecolumn="average">
      </cfchartseries>
      </cfchart>

      Many thanks for any comments