Bug in unlimited zoom in chart...

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
aselaneli
Posts: 6
Joined: Wed Dec 21, 2011 11:09 am
antibot: No, of course not.
Location: Colombo

Bug in unlimited zoom in chart...

Post by aselaneli » Tue Feb 14, 2012 11:45 am

Hi,

This post is intended for Mr. David Gilbert, the genius behind JfreeCharts.

I was testing the zooming functionality of the trends & if I keep on zooming when there's NO data left to zoom, it throws the following exception.

Code: Select all

Exception in thread "AWT-EventQueue-1" 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(Unknown Source)
	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
	at javax.swing.RepaintManager.paint(Unknown Source)
	at javax.swing.JComponent._paintImmediately(Unknown Source)
	at javax.swing.JComponent.paintImmediately(Unknown Source)
	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
It's thrown from line no 75 of RendererUtilities class & method findLiveItemsLowerBound(XYDataset dataset, int series, double xLow, double xHigh).

Wouldn't it be logical to interchange min & max values rather than throwing an exception in

Code: Select all

if (xLow >= xHigh) {
            throw new IllegalArgumentException("Requires xLow < xHigh.");
        }


Thanks & regards,
Asela.

mkrauskopf
Posts: 31
Joined: Thu May 27, 2010 4:23 pm
antibot: No, of course not.

Re: Bug in unlimited zoom in chart...

Post by mkrauskopf » Wed Feb 15, 2012 2:13 pm

Hi. Similar was discussed in viewtopic.php?f=3&t=109538 and the issue is tracked at http://sourceforge.net/tracker/index.ph ... tid=115494

Cheers,
- m.

Locked