getAxis no longer there?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Erich Kilmer

getAxis no longer there?

Post by Erich Kilmer » Mon Dec 09, 2002 9:59 pm

Used this code in the past:

VerticalNumberAxis vnAxis = (VerticalNumberAxis)chart.getPlot().getAxis(Axis.VERTICAL);
vnAxis.setLabelPaint(Color.white);
vnAxis.setTickLabelPaint(Color.white);
vnAxis.setAutoRange(true);
HorizontalDateAxis hdAxis = (HorizontalDateAxis)chart.getPlot().getAxis(Axis.HORIZONTAL);
hdAxis.setLabelPaint(Color.white);
hdAxis.setTickLabelPaint(Color.white);
hdAxis.setAutoRange(true);

Now I get errors (in the latest JFreeChart) compiling because getAxis is no longer a valid method (in the Plot class) ?

Can anyone tell me how to get the axis so that I can set the colors etc?

Thanks,

Erich

Erich Kilmer

Re: getAxis no longer there?

Post by Erich Kilmer » Mon Dec 09, 2002 10:03 pm

Never mind. I searched the archive back longer than 30 days (its been a while since I used this forum).
Axis is replaced by getDomainAxis() and getRangeAxis().
I will give these a try.

David Gilbert

Re: getAxis no longer there?

Post by David Gilbert » Mon Dec 09, 2002 10:56 pm

Hi Erich,

You are on the right track with getDomainAxis() and getRangeAxis(). Just keep in mind that getDomainAxis() returns a ValueAxis for the XYPlot class, and a CategoryAxis for the CategoryPlot class.

Regards,

DG

Locked