Rotating category text bar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Stephen Oostenbrink

Rotating category text bar chart

Post by Stephen Oostenbrink » Thu Oct 31, 2002 11:02 am

Hi,

I was wondering if there is away to rotate the category text in a bar chart. The name of the categories are quit long, which means JFreeChart starts wrapping the text. Instead of wrapping I would like the text to be rotated 90 degrees.

Regards,

Stephen

Dave Gilbert

Re: Rotating category text bar chart

Post by Dave Gilbert » Thu Oct 31, 2002 11:03 am

Yes, you need to do something like this:

CategoryPlot plot = myChart.getCategoryPlot();
HorizontalCategoryAxis axis = (HorizontalCategoryAxis) plot.getDomainAxis();
axis.setVerticalCategoryLabels(true);

Regards,

DG

Stephen Oostenbrink

Re: Rotating category text bar chart

Post by Stephen Oostenbrink » Thu Oct 31, 2002 11:17 am

Hi Dave,

Got it to work. Thanks!

- Stephen

Locked