How To: ColdFusion Chart with No Numbers

This post is more than 2 years old.

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>


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?

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

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.