CFCHART and the Case of the Disappearing Labels
A user reported an odd problem today. She was using Soundings, my ColdFusion survey application, and noticed something odd. She would do a report and the chart would be missing data! Here is an example:

This chart should have 9 items, even though some are blank, but we only see 5 labels. I did a quick google check and found out this was a known bug:
http://cfchart.blogspot.com/2005/06/charting-technote-addendum.html
Turns out that in earlier versions of CF, the labels were rotated, but a designer (darn designers!) decided that horizontal labels made more sense. I agree - but it would be nice if CF would automatically rotate them instead of just dropped them.
So I decided to make a quick XML file. From the URL above I saw that I needed to use this XML:
<xAxis>
<labelStyle isHideOverlapped="true" orientation="Horizontal"/>
<titleStyle font="Arial-12-bold" isMultiline="false"/>
</xAxis>
I didn't want to modify the core style files since that wouldn't be a solution for Soundings. According to the docs, you can use either an XML file or a string to specify style information. However, now matter what I did I couldn't get it to work. So I switched to an XML file using just the code above. This still didn't work. However, now I figured it was because I wasn't specifying a "full" style.
Now I was worried. I really did not want to specify 100 styles just to tweak one small little thing. I loaded up the WebCharts style editor. (Everyone knows about that, right? More info can be found here.) First - while this is a cool tool, I had trouble finding a "simple" bar chart. I made my best guess and took a look the XML. Turns out - the file was very simple. Even better, I was able to figure out why my XML above was missing. I changed it to this:
<?xml version="1.0" encoding="UTF-8"?>
<frameChart>
<xAxis>
<labelStyle isHideOverlapped="false" orientation="Vertical"/>
<titleStyle font="Arial-12-bold" isMultiline="false"/>
</xAxis>
</frameChart>
And that alone was enough to fix the problem. Here is the chart as it appears now:

As you can see, I lost the black borders and text, but to be honest it doesn't really bug me much.
Comments
Just out of curiosity, have you gotten webcharts to work? I created a blank direcotry called gallery and it got rid of the error, but now I go in and I can't load any charts ... hmmm ... help?
Sorry I missed the obvious, but most people don't even know the utility exists much less where to find it. What other poorly documented features are buried in CF7? Maybe the cookbook could have a category called EasterEggs...:)
Thanks!
I went on a test run. Grabbed wc50.jar and the gallery folder, put them together in a folder on a workstation and just did java -jar wc50.jar and it seems to work just fine (even with Java 1.5!).


If you use the Chart utility tool that is buried in CF you can do tons of things with charts.
Open CFusionMX7\lib\wc50.jar and create the chart you want. This utility lets you take "full" advantage of the Web Charts license. Unfortunately some of the chart types are not available. The utility will even write the xml code for you.
I did my own chart at http://www.clinfrastructure.com/clineng/index.cfm