Sunday, April 06, 2008

CFCHART tips

The charting component in Coldfusion is really quite flexible and useful.

Beyond the basic embedded styles, you can use the built in editor for the
CFCHART underlying engine, WebCharts3D.

C:\ColdFusion8\charting\webcharts.bat

Using this you can modify the style for any graph, and there's a lot
of possibilities.

The first thing i changed was turning off the animation for the flash graphs
by changing <morph morph="grow"/> to <morph morph="none">

The other default option (it's a change from the CF 7 behaviour in CFMX) is to disable the auto-interpolation. Basically, when it's enabled, any missing data will be filled in with estimated values, which is very frustrating when you don't know about it!

Thankfully I found this livedocs comment which grabbed my attention more than the change notes in the doco.

by changing this at the top of the XML style file
<frameChart autoAdjust="false" is3D="false" isInterpolated="true">
to
<frameChart autoAdjust="false" is3D="false" isInterpolated="false">

Given how easy Coldfusion is to use, i would suggest it's worth trying out if you are going to do some database driven web based charting.

I was suggest that you don't ever modify the file in the default styles directory, always make a copy in your application tree, that way it will minimise deployment hassles and we all hate them don't we?

1 comment:

Anonymous said...

Thank you!
I ran into problems caused by the auto-interpolation when migrating from CF 7 to CF 8 and yours is the only info I found related to it. It was a quick and easy save for me for many charts! Thanks for sharing it!!
Brenda