How to set the text orientation of y-axis to horizontal

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
gabbagabbahey
Posts: 10
Joined: Tue Oct 09, 2007 11:12 am

How to set the text orientation of y-axis to horizontal

Post by gabbagabbahey » Mon Oct 15, 2007 4:48 pm

Text orientation for y-axis is shown as vertical, possible to show it horizontal?

gabbagabbahey
Posts: 10
Joined: Tue Oct 09, 2007 11:12 am

I managed to get it done for X-axis, how about Y-axis?

Post by gabbagabbahey » Tue Oct 16, 2007 12:19 pm

Code: Select all

var yAxis = plot.getRangeAxis(); 
yAxis.setLabelAngle("4.712389");
Managed to get it done for X-axis, how bout y-axis?

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 » Tue Oct 16, 2007 1:47 pm

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

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

Locked