I’ve done simple line charts with ColdFusion in the past with the CFCHART tag, but a recent project had me doing more complex charting and having to use the flash chart type which I’d never used before. When making bar charts, the default behavior for Flash type graphs is a basic grow animation that looks neat when you first see it, but it gets annoying if you are constantly refreshing the chart. This also becomes problematic if the refresh rate is faster than the animation time because you never see the final data.
Ray Camden and Dan Switzer pointed me to a couple of blog posting about WebCharts3D which is included in ColdFusion 7. So I launched the application – simply executing the webcharts.bat file in the WEB-INF\cfusion\charting directory. You’re first presented with a screen where you choose the type of chart you want to build/customize.

When you select the type – and sub-type – that you want, you are taken directly to the main editor screen.

It takes some playing around to learn how to access and change the properties of any given chart style (as the interface is not incredibly intuitive) and as soon as you change any property, the example on the left is updated with a preview.
Once you have it looking the way you like, you go to the XML Style tab and click the save button. You need to save it in the WEB-INF\cfusion\charting\styles directory.

Then you simple take the name of xml file you just saved and put it in the style attribute of the CFCHART tag.
<cfchart title="My Chart" scaleFrom="0" scaleTo="100"
format="flash" chartheight="300" chartwidth="650"
markersize="1" style="my_new_chart_style">
<cfchartseries type="line" colorlist="1E90FF">
<cfchartdata value="50">
</cfchartseries>
</cfchart>
If you are unhappy with any aspect of the way your ColdFusion charts are being displayed or want to add/remove information from them, then definitely play around with WebCharts3D.
11 Responses for "Customizing Your CFCHART Results"
How do I configure this to run under CFMX 7.0.2 that’s on a Windows machine as a stand-alone server configuration for IIS (not under Apache / JRUN4)?
Andrew, I don’t believe you need any special installation instructions. What happens when you try to run the webcharts.bat file?
Steve,
I can run the batch file, select the chart I want to use, and generate the xml file. However, since I’m not running under JRun4, I don’t have the server configuration referenced in the instructions. I don’t know where to place the XML files so I can call the specific chart type I want to use (gauge). My webroot is C:\Inetpub\wwwroot and my ColdFusion installation is C:\CFusionMX7 and the webcharts.bat is located at C:\CFusionMXcharting. Any suggestions?
Andrew, the xml files are placed in the correct directory by default. I did not have to move them once they were saved.
For reference, they are saved in the cfusion\charting\styles directory, so I would guess yours are located in C:\CfusionMXCharting\styles.
I guess I don’t understand what problem you’re seeing. You originally asked how to configure this charting to run under IIS, but since you’re able to run the editor, you do have it configured.
What aren’t you able to do?
I appreciate your patience and support. The error I’m getting is:
“The chart type specified in the style is not a supported ColdFusion chart type.”
Here’s the XML File dial_chart.xml
As I stated above, thanks for your patience.
The Dial Chart and many other cool ones are unsupported by CF7 8(
I have tried your suggestions and created the file below.
-
-
However, when I try to save it to the path you suggested, I find it does not exist.
I am running MX 7.02 with both updaters installed and the report builder also installed.
I’m not an idiot, but I can’t seem to figure it out. HELP!!!
I have a site with Go Daddy so I don’t have access to the default charting/styles folder to either run the webcharts.bat file or to save the .xml files to the folder mentioned in this article. Even with those limitations I was able to get it to work. I have the Developer’s Edition of CF 7 installed on my computer so with that I can run the webcharts.bat application and generate the .xml files. Through trial and error I figured out that you can place those xml file at any level of your wwwroot and then reference them just like linking to a file. Here is an example of the cfchart code used to reference the xml file.
In this example I saved the Step_with_Percent.xml file in a folder staring at my web root named common/Chart_Styles/
Note that you have to use the .xml extension in the file path for this method to work.
[...] public links >> cfchart Customizing Your CFCHART Results Saved by guchen on Thu 13-11-2008 Fix: Bludragon7 tag and apache2 Saved by FUCKROFMOM on Sun [...]
I have been unable to get the customization working.
I use a custom xml file called test.xml and I use the CFChart below to display my chart. What I need to happen is to display the zeors after decimal place for all values, but none of the zeos after decimal point show up. Could this be a bug in CFChart?
Here is my code:
and here is my XML file:
Hi Steve
I have a normal chart ( type=”horizontalbar”) Is there any way by which I could put the X axis on the top ? Sort of like primaryXAxisplacement = Top|Bottom. I didn’t find this setting in CF 8 / WebCharts3D 5.1. Any Idea how this could be done? Please help me
Thanks in Advance
Leave a reply