XYPlot.setRangeAxis()

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

XYPlot.setRangeAxis()

Post by Ted Hill » Tue Aug 27, 2002 4:50 pm

Hello,

I am trying to figure out how to change from 'normal' range axis to logarithmic axis dynamically. I have a small test program with a button as follows:

JButton rangeButton = new JButton("Change Range");
rangeButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("rangeButton.actionPerformed");
VerticalLogarithmicAxis logAxis = new VerticalLogarithmicAxis("Log Axis");
plot.setRangeAxis(logAxis);
}
});

When I click the button nothing happens. I would have expected the chart to redraw with the new axis, but it doesn't.

I'm using version 0.9.2

Can anyone tell me how to do this?

Thank you,

Ted Hill

David Gilbert

Re: XYPlot.setRangeAxis()

Post by David Gilbert » Tue Aug 27, 2002 5:48 pm

Hi Ted,

I would have expected that to work too, but it doesn't because the setRangeAxis(...) method is not firing an AxisChangeEvent. I think it should be easy to add the event, but I'll have to do some tests to make sure it doesn't mess anything else up.

Regards,

DG.

Locked