I've created a chart using the ChartFactory class createBarChart method and now I need to change the angles of the labels of the x-axis just like the demo DualAxisDemo1.png on this website (I can't post any URL's =( )
I've noticed a method in the Axis class setLabelAngle(), but I can't use it unless I can grab hold of the X-axis object created in the graph.
Any ideas on how to do this?
Thank you.
How to change the x-axis label angle?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
To get a reference to the axis:
The source code for all the demos is available to download when you buy the JFreeChart Developer Guide - it will save you a lot of time I think.
Code: Select all
CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryAxis axis = plot.getDomainAxis();
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

