jfree/orson-charts

XYZPlot.axisChanged() method error ?

fbuloup opened this issue · 2 comments

Hello and thanks for sharing this 3d Chart library :-)

In method axisChanged() of xyzPlot (line 682) we have :

public void axisChanged(Axis3DChangeEvent event) {
        this.yAxis.configureAsYAxis(this);
        fireChangeEvent(event.requiresWorldUpdate());
}

Shouldn't it be :

public void axisChanged(Axis3DChangeEvent event) {
    	if(xAxis == event.getAxis()) 
    		xAxis.configureAsXAxis(this);
    	if(yAxis == event.getAxis()) 
    		yAxis.configureAsYAxis(this);
    	if(zAxis == event.getAxis()) 
    		zAxis.configureAsZAxis(this);
        fireChangeEvent(event.requiresWorldUpdate());
}

This is actually what I've done and it solved bad axis range.

https://github.com/jfree/orson-charts/blob/master/src/main/java/org/jfree/chart3d/plot/XYZPlot.java

jfree commented

I think you are correct. I will write some JUnit tests to prove it.

jfree commented

Fixed for the upcoming 2.1.0 release. Thanks for reporting it.