GetDomainExtent exception from OverlaidXYPlot

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

GetDomainExtent exception from OverlaidXYPlot

Post by Aaron Metzger » Sat Apr 27, 2002 12:12 am

I have an OverlaidXYPlot with the first plot containing a few dozen data points and the second plot containing only a single data point which is to be rendered as a shape.

OverlaidXYPlot.add throws the following exception due to the call to getDomainExtent. I added a print statement to the end of GetDomainExtent to report the values. When there are two or more values in the second plot, then everything works ok. I think a single point should be ok when rendered as a shape.

[java] GetDomainExtent: minimum is 1.011913318148E12; maximum is 1.013040118148E12.
[java] GetDomainExtent: minimum is 1.013040118148E12; maximum is 1.013040118148E12.
[java] at com.jrefinery.data.Range.<init>(Range.java:60)
[java] at com.jrefinery.data.DatasetUtilities.getDomainExtent(DatasetUtilities.java:156)
[java] at com.jrefinery.chart.XYPlot.getHorizontalDataRange(XYPlot.java:691)
[java] at com.jrefinery.chart.OverlaidXYPlot.getHorizontalDataRange(OverlaidXYPlot.java:237)
[java] at com.jrefinery.chart.HorizontalDateAxis.autoAdjustRange(HorizontalDateAxis.java:332)
[java] at com.jrefinery.chart.HorizontalDateAxis.configure(HorizontalDateAxis.java:261)
[java] at com.jrefinery.chart.OverlaidXYPlot.add(OverlaidXYPlot.java:118)

David Gilbert

Re: GetDomainExtent exception from OverlaidXYPlot

Post by David Gilbert » Mon Apr 29, 2002 5:41 am

In the constructor for the Range class, there is a check to make sure that the first value (lower) is less than the second value (upper). It should probably be less than or equal to...

Regards,

DG.

Locked