Ask a Jedi: Another Chart Question

This post is more than 2 years old.

Woohoo! I love these chart questions. I guess I'm a chart geek. Randy asks:

Is there a way for the bottom labels on a cfchart to show vertically on the graph instead of horizontal.

I bet folks know what I'm going to say. Once again, the built in chart editor comes in handy. This one was pretty simple - I just changed the XAxis/Style/Label/Orientation setting to Vertical. I grabbed the XML and edited it like so:

<frameChart> <xAxis> <labelStyle orientation="Vertical"/> </xAxis> </frameChart>

Passing this to my chart resulted in the following:

And for comparison's sake, here is horizontal:

You also have options for Slanted and Parallel. Parallel looked mostly like Horizontal, but here is an example of Slanted:

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 https://www.raymondcamden.com

Archived Comments

Comment 1 by Tom Chiverton posted on 2/15/2008 at 9:04 PM

"the built in chart editor"
That's the second time you've said that, but I'm not sure what it's meant to be built into...

Comment 2 by Raymond Camden posted on 2/15/2008 at 9:11 PM

In your CF install folder, go to the charting folder and run webcharts.bat.

Comment 3 by Tom Chiverton posted on 2/15/2008 at 9:31 PM

Ahh, Linux guy walking, so it's at /opt/coldfusion8/charting/webcharts.sh

That's very cool. Is it documented anywhere ?

Comment 4 by Raymond Camden posted on 2/15/2008 at 9:34 PM

I believe so. It doesn't run at all on my Mac, so I use my Windows box when I play with it.

Comment 5 by Tucson Web Design posted on 2/16/2008 at 7:21 AM

Thanks, I have been looking for this information all day! I love cfchart!!

Comment 6 by Andrew posted on 2/16/2008 at 6:07 PM

If you don't want to mess with webcharts you can create an xml file with all of your chart styles defines and then use the style attribute of the cfchart tag to point to your xml file. This gives you the option of applying specific styles to specific types of charts within your app.

Comment 7 by Derek posted on 4/29/2008 at 1:31 AM

I assume that chaning the webcharts.bat impacts all of the charts that are generated on the server. Is there a way to just control the orientation of the labels within my app so as not to affect the orientation for other developers on the server? I saw reference to creating XML file referenced through the style attribute in cfchart, but not really sure how to do that.

Comment 8 by Raymond Camden posted on 4/29/2008 at 1:41 AM

Derek, you are incorrect. You never change webcharts.bat. You _run_ it. This runs a program that lets you generate an XML file you can pass to cfchart.

Comment 9 by Derek posted on 4/29/2008 at 1:44 AM

Thanks for the clarification. I think that I just found what you are talking about. Is there any place that I can find some steps to help this newbie succeed?

Comment 10 by Raymond Camden posted on 4/29/2008 at 1:46 AM

If you search my blog for cfchart, I don't have a guide per se, but I have a lot of examples. Also google around for Tim Buntel's blog as he did a simply entry _just_ on this topic.

Comment 11 by CfL00zer posted on 5/15/2009 at 8:03 PM

I wonder if anybody has this issue:
I have added Yaxis title, it works fine for 2 bars, but the third bar shows to yaxis title in popup.

your help be apreciated

Comment 12 by CfL00zer posted on 5/15/2009 at 8:09 PM

To Raymond Camden
in spot light type: wc50.jar, click on it, the web chart should load same as PC.

Comment 13 by Raymond Camden posted on 5/15/2009 at 8:12 PM

@CfLoozer- yep, I realize that now. No longer using RDP to hit Windows to run the chart editor.

@CfLoozer - got a screen shot or a reproducable case?

Comment 14 by Eunice K posted on 8/4/2010 at 11:23 PM

The xml file is located here: \cfusion.ear\cfusion.war\WEB-INF\cfusion\charting\styles for me

Comment 15 by Kovacs Stefan posted on 9/29/2010 at 5:32 PM

I'd like to know if it is posible how to make the value label on vertical.
Thank you

Comment 16 by Raymond Camden posted on 10/3/2010 at 7:55 PM

Sorry - what part?

Comment 17 by Kovacs Stefan posted on 10/4/2010 at 11:32 AM

I have a chart like this.
<cfchart format="png" chartheight="200" scalefrom="0" labelformat="number" rotated="yes" tipstyle="mouseOver" >
<cfchartseries type="bar" serieslabel="no" >
<cfchartdata item="2000" value="200.0">
<cfchartdata item="2001" value="200.0">
<cfchartdata item="2002" value="250.0">
<cfchartdata item="2003" value="130.0">
<cfchartdata item="2004" value="450.0">
<cfchartdata item="2005" value="250.0">
</cfchartseries>
<cfchartseries type="bar" serieslabel="no" >
<cfchartdata item="2000" value="100.0">
<cfchartdata item="2001" value="100.0">
<cfchartdata item="2002" value="150.0">
<cfchartdata item="2003" value="130.0">
<cfchartdata item="2004" value="250.0">
<cfchartdata item="2005" value="150.0">
</cfchartseries>
<cfchartseries type="bar" serieslabel="Sample 1" datalabelstyle="value" markerstyle="circle">
<cfchartdata item="2000" value="150.0">
<cfchartdata item="2001" value="300.0">
<cfchartdata item="2002" value="250.0">
<cfchartdata item="2003" value="230.0">
<cfchartdata item="2004" value="250.0">
<cfchartdata item="2005" value="450.0">
</cfchartseries>
</cfchart>

I wonder if it is possible to show vertically the values of each element (enabled with datalabelstyle="value" on cfchartseries tag), because now some values are not readable.
Thank you very much.

Comment 18 by Raymond Camden posted on 10/6/2010 at 12:22 AM

As far as I can see, from the Chart Designer, there is no way to do this. I'd recommend widening your chart size.

Comment 19 by Kovacs Stefan posted on 10/6/2010 at 1:46 PM

Thank you for your time...

Comment 20 by Reuben posted on 6/17/2013 at 9:28 PM

Is this possible in Coldfusion 10?

Comment 21 by Raymond Camden posted on 6/17/2013 at 10:08 PM

CF10 still ships the old engine too.

Comment 22 by Reuben posted on 6/20/2013 at 7:26 PM

Found this feature for coldfusion 10 thanks to
http://www.cfuser.com/coldf...