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> </code>

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 developer advocate. He focuses on JavaScript, serverless 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 https://www.raymondcamden.com

Comments