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)