Hi everybody !
I am trying to rotate the labels on a timeseries chart ? Is there a similar function to SetCategoryLabelPositions ?
Many thanks in advance !!
Axel
TimeSeries Chart
Thanks for your answer.
Unfortunately I still have the problem
I found this old post
http://www.jfree.org/phpBB2/viewtopic.p ... 34df545000
I don't know it this feature was implemented in the meantime.... if somebody know, it would really help me !
Unfortunately I still have the problem

I found this old post
http://www.jfree.org/phpBB2/viewtopic.p ... 34df545000
I don't know it this feature was implemented in the meantime.... if somebody know, it would really help me !
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
There isn't a general rotation option available for the DateAxis (and NumberAxis), but you can call setVerticalTickLabels(true) to have the labels rotated by 90 degrees (the method is badly named, I know).
If you are getting overlapping labels on a DateAxis, this means you've specified a fixed tick size rather than letting JFreeChart choose a size automatically...perhaps you want to revert to the default behaviour?
If you are getting overlapping labels on a DateAxis, this means you've specified a fixed tick size rather than letting JFreeChart choose a size automatically...perhaps you want to revert to the default behaviour?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Thanks for yor answer David ! The setVerticalTickLabels functions very well ! It makes my chart readable now !
Concerning the overlapping lables problem, I have not specified any fixed tick size ... or at least it was not deliberate
Could you just tell me how I could revert to the default sizing behaviour ? Here is my code
Once again, many thanks for your help !
Concerning the overlapping lables problem, I have not specified any fixed tick size ... or at least it was not deliberate

Could you just tell me how I could revert to the default sizing behaviour ? Here is my code
Code: Select all
DateAxis timeAxis = new DateAxis("");
timeAxis.setVerticalTickLabels(true);
NumberAxis valueAxis = new NumberAxis("");
timeAxis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH, 1, sdf));
(CategoryLabelPositions.UP_45);
StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES + StandardXYItemRenderer.SHAPES,ttg, urlg);
renderer.setShapesFilled(true);
XYPlot plot = new XYPlot(xyDataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart("Réparations pour la ligne: "+section, JFreeChart.DEFAULT_TITLE_FONT, plot, false);