Hi:
I am trying to change the line style of a series as I add it to an XY PLot.
The first time I add a series to a plot and change the color and line style everything works fine.
When I add a second time series to the plot and modify the line style via
the setSeriesStroke method I get the following exception:
java.lang.ArrayIndexOutOfBoundsException
[java] at com.jrefinery.chart.Plot.setSeriesStroke(Unknown Source)
Here is how my code looks:
historyPlot.setSeriesStroke(lCurrentListIndex,
LineFactory.getLine(lCurrentListIndex));
historyPlot.setSeriesPaint(lCurrentListIndex,aColor);
If you notice, both methods are using the same index and the setSeriesPaint method works!!!
Does setSeriesPaint() take the index of the time series as the first argument?
Any help would be greatly appreciated,
Alex
setSeriesStroke Bug?
Re: setSeriesStroke Bug?
Hi Alex,
There is an array of Paint objects and an array of Stroke objects that the chart cycles through. By default, the series paint array has 9 items, whereas the stroke array has only 1 item. The setSeriesStroke(...) method was intended to replace one item in the array, but requires care to make sure you don't go outside the array bounds.
The whole scheme is changed in the upcoming 0.9.5 release, to provide better support for complex combined charts.
Regards,
Dave Gilbert
There is an array of Paint objects and an array of Stroke objects that the chart cycles through. By default, the series paint array has 9 items, whereas the stroke array has only 1 item. The setSeriesStroke(...) method was intended to replace one item in the array, but requires care to make sure you don't go outside the array bounds.
The whole scheme is changed in the upcoming 0.9.5 release, to provide better support for complex combined charts.
Regards,
Dave Gilbert
Re: setSeriesStroke Bug?
Hi Dave,
Thanks for the response. How do I change the Line Style everytime I add a new series to a Chart? What is the best appoach?
Alex
Thanks for the response. How do I change the Line Style everytime I add a new series to a Chart? What is the best appoach?
Alex