Zoom Problem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Fran Tonello
Posts: 8
Joined: Thu Mar 20, 2003 7:45 pm

Zoom Problem

Post by Fran Tonello » Mon Mar 31, 2003 7:49 pm

Hi Gang,

When I set chartPanel.setMouseZoomable(true), we start seeing the following error when the user zooms-in repeatedly:

Range(double, double): require lower <= upper

This happens after the user has zoomed in a bunch of times and the chart has auto-range turned off. (Where "bunch" is typically: 5 <= bunch <= 10.)

Fran

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

Post by david.gilbert » Tue Apr 01, 2003 11:52 pm

Hi Fran,

I've tried to reproduce this problem, but couldn't get it to happen. Which version are you using, JDK and OS etc?

Regards,

Dave Gilbert

Fran Tonello
Posts: 8
Joined: Thu Mar 20, 2003 7:45 pm

Post by Fran Tonello » Wed Apr 02, 2003 2:08 am

Hi Dave,

We're using JRE 1.4.0 and 1.4.1, JFreeChart 0.9.6. The problem occurs on line charts with auto range turned off and the following executed before every update:

Code: Select all

if ( (! plot.getVerticalValueAxis().isAutoRange()) ||
     (maxValue < plot.getVerticalValueAxis().getMaximumAxisValue()) ) {
  plot.getVerticalValueAxis().setRange(0, maxValue);
  plot.getVerticalValueAxis().setMinimumAxisValue(0);
  plot.getVerticalValueAxis().setMaximumAxisValue(maxValue);
}
With the above code in place, here's the stack trace you get:

Code: Select all

sun.dc.pr.PRException: endPath: bad path
at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:45)
at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2162)
at com.jrefinery.chart.renderer.StandardXYItemRenderer.drawItem(Unknown Source)
at com.jrefinery.chart.plot.XYPlot.render(Unknown Source)
at com.jrefinery.chart.plot.XYPlot.draw(Unknown Source)
at com.jrefinery.chart.JFreeChart.draw(Unknown Source)
at com.jrefinery.chart.ChartPanel.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(JComponent.java:804)
at javax.swing.JComponent.paintChildren(JComponent.java:643)
at javax.swing.JComponent.paint(JComponent.java:813)
at javax.swing.JComponent.paintChildren(JComponent.java:643)
at javax.swing.JComponent.paint(JComponent.java:813)
at javax.swing.JComponent.paintChildren(JComponent.java:643)
at javax.swing.JComponent.paint(JComponent.java:813)
at javax.swing.JComponent.paintChildren(JComponent.java:643)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4742)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
at javax.swing.JComponent._paintImmediately(JComponent.java:4632)
at javax.swing.JComponent.paintImmediately(JComponent.java:4464)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:404)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
With the above code commented-out, you get this stack trace:

Code: Select all

java.lang.IllegalArgumentException: DateAxis.setRange(...): lower >= upper.
at com.jrefinery.chart.axis.DateAxis.setRange(Unknown Source)
at com.jrefinery.chart.ChartPanel.zoom(Unknown Source)
at com.jrefinery.chart.ChartPanel.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:228)
at java.awt.Component.processMouseEvent(Component.java:5021)
at java.awt.Component.processEvent(Component.java:4818)
at java.awt.Container.processEvent(Container.java:1380)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Container.dispatchEventImpl(Container.java:1437)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
at java.awt.Container.dispatchEventImpl(Container.java:1423)
at java.awt.Window.dispatchEventImpl(Window.java:1566)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Hope this helps!
Fran

Fran Tonello
Posts: 8
Joined: Thu Mar 20, 2003 7:45 pm

Post by Fran Tonello » Wed Apr 02, 2003 2:11 am

Oh, and we see the problem on Solaris and Windows. We didn't try it on Linux, but from the trace, it looks like it'll happen there, too.

aloleary
Posts: 20
Joined: Wed Mar 26, 2003 4:32 pm
Location: Dublin, Ireland

Same problem (FYI)

Post by aloleary » Wed Apr 02, 2003 10:38 am

I see the very same problem/stack trace when Zooming in on a graph line.....

AFAIK there has to be a graph line showing, i.e. zoom in on a vertex continuously....

My set up is :

- java version "1.4.1_02"
- Windows 2000 SP3


-A

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

Post by david.gilbert » Wed Apr 02, 2003 10:57 pm

I can get the PRException, but not the other one. Can anyone post a demo application that fails? It could be that the charts I'm using to test with have something set up that doesn't trigger the bug...

Regards,

Dave Gilbert

Locked