Rotating the X-Axis labels 45 degrees with XYLineChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
the_schmitz
Posts: 13
Joined: Thu May 18, 2006 6:01 pm
Location: Washington DC

Rotating the X-Axis labels 45 degrees with XYLineChart

Post by the_schmitz » Thu May 18, 2006 6:04 pm

Hello,
I'm trying to rotate the X-Axis data point labels on an XYLineChart, and I can't seem to figure it out. On a bar chart, it's pretty straight forward:

Code: Select all

CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
But I can't seem to figure out how to do it with an XYLineChart, any help is appreciated.

Thanks
Chris

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri May 19, 2006 10:12 am

This is supported in the CategoryAxis class, but not the NumberAxis or DateAxis classes. It is inconsistent, so eventually it needs to be fixed...but it isn't straightforward because the tick labelling code in the NumberAxis and DateAxis classes is a lot more complex than it is in the CategoryAxis class.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked