I am creating the X and Y axis of the jfreechart using symbol axis and want to rotate its tick mark labels by any angle say 45. Using setSeriesPositiveItemLabelPosition() is not working.
Any way to do so?
Symbol Axis rotation
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Symbol Axis rotation
There isn't a way to do that. I can see why it would make sense...it has been implemented for CategoryAxis (even if the API is a bit awkward) but for the ValueAxis subclasses (NumberAxis, DateAxis) it was less useful, so it was not implemented. SymbolAxis subclasses NumberAxis so didn't get this tick label rotation feature either. It wouldn't be that hard to do, but it would involve updating the auto tick unit selection code which would be a small challenge. If you have a go at it, please post a patch online somewhere, I'm sure others will find it useful.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Symbol Axis rotation
This isn't totally working I think (It's more that I didn't totally understand how it work) but with a ValueAxis you can do this :
Code: Select all
yourValueAxis.setLabelAngle(90);
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Symbol Axis rotation
That option is for the axis label not the tick labels.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Symbol Axis rotation
My bad didn't see that was for a tick label