Exception: Requires xLow < xHigh when zooming

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
vulgaerius
Posts: 2
Joined: Thu Apr 14, 2011 11:52 am
antibot: No, of course not.

Exception: Requires xLow < xHigh when zooming

Post by vulgaerius » Fri Apr 15, 2011 10:04 am

Hy all,

i have seen some strange behavior reproducible in XYStepRendererDemo1 from the Developers Guide (v. 1.0.13).
After a few zooms (7-10) on a line the line disappear.
After one more zoom (on the empty chart) it throws the exception:

Code: Select all

Exception in thread "AWT-EventQueue-0" 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)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
        at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479)
        at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410)
        at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:294)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Is JFreeChart not unlimited zoomable?
Thanks so much in advance

fischerw
Posts: 3
Joined: Wed Aug 25, 2010 6:16 pm
antibot: No, of course not.

Re: Exception: Requires xLow < xHigh when zooming

Post by fischerw » Tue May 10, 2011 11:02 pm

I also have run into this exception. In my case, it is happening whenever I try to zoom by clicking on the plot, then dragging the mouse down and to the left.

I have looked into overriding the mousePressed, mouseDragged, and mouseReleased to fix this. But, there are so many private variables in ChartPanel that I end up having to override many other methods.

Seems like this should be a simple fix. Instead of always assuming the mouse point x and/or y is greater than the zoomPoint x and/or y, set the zoomRectangle based on which is greater.

Locked