How To: ColdFusion Chart with No Numbers

This question came in via my forums, but I thought it would make a nice blog post. wolfee asks:

Is it possible to show a cfchart with bars but exclude the values (both on the verticle axis and on rollover? I'd like to give a visual indication of scores but not reveal the actual scores. Thankyou for any tips offered!

The answer is - of course - yes - since everything is possible with ColdFusion. (Ok, maybe not everything, but darn close!)

As always, the answer is in the chart editor. I opened it up and simply disabled the Y-Axis. I then disabled Popup. That's it. Done. Here is a simple example:

<cfsavecontent variable="style"> <?xml version="1.0" encoding="UTF-8"?> <frameChart is3D="false"> <frame xDepth="12" yDepth="11"/> <yAxis isVisible="false" scaleMin="0" /> <popup showOn="Disabled"/> </frameChart> </cfsavecontent>

<cfchart format="flash" xaxistitle="Fleet" yaxistitle="numbers" style="#style#">

<cfchartseries type="bar" serieslabel="result"> <cfchartdata item="Cylons" value="75"> <cfchartdata item="Colonials" value="80"> </cfchartseries>

</cfchart>

Note - I stripped the XML down to the bare minimum to get it working, but you get the idea. The visual result is:

Just pretend you can mouse over that and nothing shows up. Trust me - it works. ;) I'm not convinced this is 100% safe though. I bet you could get the SWF, decompile it, and see the numbers. Anyone want to try?

Archived Comments

Comment 1 by Joel Cox posted on 3/10/2009 at 12:39 AM

To guard against accessing the raw data via decompilation, you could always normalize the values.

Cylons value = 0.9375 (75/80)
Colonials value = 1.0 (80/80)

Comment 2 by Raymond Camden posted on 3/10/2009 at 12:42 AM

Word. That's perfect. Math FTW. :)

Comment 3 by Raymond Camden posted on 3/10/2009 at 12:48 AM

Another idea would be to just use PNG/JPG format. No numbers there.