troubleshooting Question

Graphing Script Data with <cfchartseries>

Avatar of KCody
KCodyFlag for United States of America asked on
JavaScriptWeb ServersColdFusion Language
3 Comments1 Solution223 ViewsLast Modified:
I'm querying a SQL table and then taking that data and using Javascript to calculate the values I need for my graph.  However, when I reference the variable that has the value assigned to it from <cfchartseries> I am not getting anything in my graph.  If I display the values in a table it works perfectly but I need to get this data into a graph and <cfchartseries doesn't like it>.  I can use <cfchartdata> and it graphs it correctly but I get invidiual graphs for each value returned and I want all the values on one graph like the chart series does.  Is this possible?  Here is a very simplified example of what I'm trying to do:
<cfquery name="data" datasource="database" dbtype="ODBC">
SELECT     idnum, time, value1, value2
            FROM    DATA_DETAIL
            WHERE idnum = '#idnum#' AND time > '#readtime#'
            ORDER By time
</cfquery>
<SCRIPT>
var val1=#value 1#
var val2=#value2#
var val3=((val1-val2)-10)
document.write('<tr>')
document.write('<td><font size="-1">#idnum#</font></td>')
document.write('<td><font size="-1">#time#</font></td>')
document.write('<td><font size="-1">#value1#</font></td>')
document.write('<td><font size="-1">#value2#</font></td>')
document.write('<td><font size="-1">' + val3 + '</font></td>')
document.write('</tr>')
</script>

Val3 prints out to the screen like it should in the table and life is good.  Now, how do I get this value into a coldfusion chart??  Before anyone asks, I know I can do this basic type math directly in SQL but my example is simplified in my real app I have to read in several values and do calculations on them in addition to if..then statements to determine values so that is why I'm having to use Javascript.
ASKER CERTIFIED SOLUTION
Scott Bennett
Manager Technology

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
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 1 Answer and 3 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