Strange behavior of XYLineAnnotation with dashed strokes....

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Commander Salamander
Posts: 21
Joined: Sat Jan 05, 2008 2:14 am

Strange behavior of XYLineAnnotation with dashed strokes....

Post by Commander Salamander » Tue Oct 28, 2008 9:41 pm

I have encountered what might qualify as a bug in JFreechart 1.0.11.

I have an XYPlot with a very large domain number axis (integers from 1 - 1,000,000). I place an XYLineAnnotation spanning the full length of this axis. If I use a standard basic stroke (e.g. new BasicStroke(1)), I have no troubles. But if I use a dashed stroke, I encounter extremely slow response from the ChartPanel if I view a small (but not large!) section of the XYPlot (by changing the domain axis bounds).

In other words, if I view the domain axis from 100,000-120,000, the chart is very responsive. If I view from 100,000-100,500, the chart loads extremely slowly. I understand that rendering a dashed line might be more computationally expensive, but the fact that it is drawn quickly when a larger chunk of the plot is viewed doesn't make sense.

The stroke I'm using is supplied below:

Code: Select all

new BasicStroke(
			1f, 
			BasicStroke.CAP_BUTT, 
			BasicStroke.JOIN_BEVEL, 
			0, 
			new float[]{5f,1f}, 
			0)

Commander Salamander
Posts: 21
Joined: Sat Jan 05, 2008 2:14 am

Post by Commander Salamander » Tue Nov 04, 2008 5:25 pm

Hmmmm.. still no comments. I acknowledge that this isn't a hugely important issue, but I'm fairly sure it points to some sort of underlying bug. I went ahead and submitted the issue to SourceForge. Here is the link if anyone wants to check the status:

https://sourceforge.net/tracker2/?func= ... tid=115494

Locked