Code: Select all
java.lang.NullPointerException
at com.eoscene.cdds.chart.plot.CategorySubplot.getRangeAxis(CategorySubplot.java:55)
at org.jfree.chart.plot.CategoryPlot.getDataRange(CategoryPlot.java:2430)
at org.jfree.chart.axis.NumberAxis.autoAdjustRange(NumberAxis.java:350)
at org.jfree.chart.axis.NumberAxis.configure(NumberAxis.java:333)
at org.jfree.chart.axis.Axis.setPlot(Axis.java:686)
at org.jfree.chart.plot.CategoryPlot.setRangeAxis(CategoryPlot.java:708)
at com.eoscene.cdds.chart.builder.AssetTypeChartBuilder.getPlot(AssetTypeChartBuilder.java:103)
at com.eoscene.cdds.chart.builder.AssetTypeChartBuilder.getChart(AssetTypeChartBuilder.java:81)
at com.eoscene.cdds.chart.builder.AssetTypeChartBuilder.displayChart(AssetTypeChartBuilder.java:63)
at com.eoscene.cdds.chart.builder.OptionsChartBuilder.main(OptionsChartBuilder.java:169)
Current implementation:
Code: Select all
public void setRangeAxis(ValueAxis axis) {
if (axis != null) {
axis.setPlot(this);
}
// plot is likely registered as a listener with the existing axis...
if (this.rangeAxis != null) {
this.rangeAxis.removeChangeListener(this);
}
this.rangeAxis = axis;
if (axis != null) {
axis.configure();
axis.addChangeListener(this);
}
notifyListeners(new PlotChangeEvent(this));
}
Code: Select all
public void setRangeAxis(ValueAxis axis) {
// plot is likely registered as a listener with the existing axis...
if (this.rangeAxis != null) {
this.rangeAxis.removeChangeListener(this);
}
this.rangeAxis = axis;
if (axis != null) {
axis.setPlot(this);
axis.configure();
axis.addChangeListener(this);
}
notifyListeners(new PlotChangeEvent(this));
}