My Favorite Thing About Coldfusion

M

I’ll be honest; I have not written a line of Coldfusion in over 5 years.  It was one of the first languages I used professionally, I must emphasize that it wasn’t personally!

But when I was regularly using it there was one function that I miss and wish was in other languages.  That function is cfchart!

P.S. yes this is really off topic, but after I got a LinkedIn message about a Coldfusion developer, it made me think back to my beginning days of development.

 In all seriousness, cfchart was an extremely useful function.  In reviewing Adobe’s tech specs here:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7930.html

It’s pure genius that I can do the following:

[code]
<cfchart format=”flash”
xaxistitle=”Department”
yaxistitle=”Salary Average”>

<cfchartseries type=”bar”
query=”DataTable”
itemcolumn=”Dept_Name”
valuecolumn=”avgSal”>

<cfchartdata item=”Facilities” value=”35000″>

</cfchartseries>
</cfchart>
[/code]

Where DataTable is a cfquery:

[code]
<cfquery dbtype = “query” name = “DataTable”>
SELECT Dept_Name,
AVG(Salary) AS avgSal,
SUM(Salary) AS sumSal
FROM GetSalaries
GROUP BY Dept_Name
</cfquery>
[/code]

A basic bar chart will be created where Dept_Name will be used for the items and avgSal will be used to plot the chart – pure awesomeness!

That was a blast from the past, sorry I don’t have an example or picture to show – I don’t even have Coldfusion running anywhere to create the most simplistic example…

About the author

By Jamie

My Books