How to set the text orientation of y-axis to horizontal
-
- Posts: 10
- Joined: Tue Oct 09, 2007 11:12 am
How to set the text orientation of y-axis to horizontal
Text orientation for y-axis is shown as vertical, possible to show it horizontal?
-
- Posts: 10
- Joined: Tue Oct 09, 2007 11:12 am
I managed to get it done for X-axis, how about Y-axis?
Code: Select all
var yAxis = plot.getRangeAxis();
yAxis.setLabelAngle("4.712389");
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The code you posted is for the y axis, so I'm confused. Anyway, this works for me:
Code: Select all
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setLabelAngle(Math.PI / 2.0);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

