Skip to main content
March 13, 2009
Question

Time Values In CFChart

  • March 13, 2009
  • 2 replies
  • 756 views
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
This topic has been closed for replies.

2 replies

Inspiring
September 11, 2009
The chart does not work, it wont accept time values.

Can you pls quantify "does not work" and "won't accept"?

What do you get: an error; unexpected output; what?

--

Adam

pyae phyoe shein
Known Participant
September 11, 2009

I'm not clear what you want to mean. So, I've attached Chart Image as far as I know regarding your message.