ColdFusion Charts cfchart on MX7

I needed to quickly put up a graph that compared last year’s
numbers to this years. In the past, using the old charting tools that
ColdFusion 5.0 offered turned out to be worthless when you needed to
compare two sets of numbers on the same graph. Not any more!

Here is a quick example of how to use the charting tools leveraging
the Flash Format:

<cfchart format=”flash” font=”arialunicodeMS” xaxistitle=”Month”
yaxistitle=”Sales Numbers” showlegend=”yes”>
<cfchartseries type=”line” serieslabel=”2005″>
<cfloop index=”i” list=”Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec”>
<cfchartdata item=”#i#” value=”#RandRange(5000,10000)#”>
</cfloop>
</cfchartseries>
<cfchartseries type=”line” serieslabel=”2006″>
<cfloop index=”j” list=”Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec”>
<cfchartdata item=”#j#” value=”#RandRange(8000,15000)#”>
</cfloop>
</cfchartseries>
</cfchart>

( view it in action here: http://www.cfblogs.com/vincecollins/cfchart/ )

Just replace each cfchartseries with a new set of data and iterate
through it and you are all set!

How cool and easy is that?

Posted in Adobe, ColdFusion.

Leave a Reply