Zooming in too far with DateAxis throws Exception in 1.0.13

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
MitchBuell
Posts: 47
Joined: Thu Dec 11, 2008 7:59 pm

Zooming in too far with DateAxis throws Exception in 1.0.13

Post by MitchBuell » Wed Apr 22, 2009 8:09 pm

In JFreeChart 1.0.13, when using a DateAxis, after zooming in enough I get an Exception thrown:

Code: Select all

java.lang.IllegalArgumentException: Requires xLow < xHigh.
	at org.jfree.chart.renderer.RendererUtilities.findLiveItemsLowerBound(RendererUtilities.java:75)
	at org.jfree.chart.renderer.RendererUtilities.findLiveItems(RendererUtilities.java:261)
	at org.jfree.chart.plot.XYPlot.render(XYPlot.java:3729)
	at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3310)
	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1235)
	at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1668)
Then the chart stops drawing correctly and can't be recovered.

It's easy to demonstrate this when using already small test data:

Code: Select all

for (int i = 0; i < 10; ++i)
        {
        	xyseries.add(i, Math.random());
        }
And start zooming in.

I understand that the DateAxis will interpret the X-value as milliseconds since the epoch, and that zooming in this far is rather pointless, the problem is that doing so will destroy the JFreeChart. Not even Auto Range fixes it.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Zooming in too far with DateAxis throws Exception in 1.0.13

Post by david.gilbert » Thu Apr 23, 2009 10:02 am

Thanks for the report. I thought I *had* squashed that bug during development...but obviously not! I'll try again.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

MitchBuell
Posts: 47
Joined: Thu Dec 11, 2008 7:59 pm

Re: Zooming in too far with DateAxis throws Exception in 1.0.13

Post by MitchBuell » Thu Apr 23, 2009 3:13 pm

NumberAxis also have this problem, but you have to keep zooming in a lot further then a DateAxis.

In the process of continually zooming in, at some point the tick mark scale on the Domain and Range Axis completely disappears. You've zoomed in so far, all you see is the Axis label. At this point there's little use in zooming in any further, but after 10 or so more zoom ins, the same Exception is thrown and the JFreeChart is destroyed.

tanklm
Posts: 1
Joined: Wed Aug 18, 2010 8:28 pm
antibot: No, of course not.

Re: Zooming in too far with DateAxis throws Exception in 1.0.13

Post by tanklm » Wed Aug 18, 2010 8:30 pm

Is there a work-around for this bug?

einav.l@correlix.com
Posts: 1
Joined: Thu Oct 28, 2010 9:48 am
antibot: No, of course not.

Re: Zooming in too far with DateAxis throws Exception in 1.0.13

Post by einav.l@correlix.com » Sun Oct 31, 2010 8:06 am

Hi,
I have exactly the same problem when zooming into the chart.
Is there a fix or a workaround ?
Please assist
I need it urgently.
Thanks
Efrat

Locked