Hi. I have a simple XY graph that graphs two values, one on x-axis and one on y-axis.
There are two lines, one for "normal" conditions, and the other for "experiment" conditions. I would like one of them to be a dashed line, and the other to be a normal continuous line.
Thus the XYDataset is an XYSeriesCollection containing two XYSeries.
I tried the following.
JFreeChart chart = ChartFactory.....
Plot plot = chart.getPlot()
Then I tried plot.setSeriesOutlineStroke (1, new BasicStroke (....))
I used 1 as I assumed the first series would be index 0, but it gives me an ArrayOutofBoundsException. Could you please help me out here?
Thanx in advance.
different strokes for different lines
Re: different strokes for different lines
You need to use the setSeriesStroke(...) method rather than the setSeriesOutlineStroke(...) method. Use the method that accepts an array, and make sure that your array has at least two Stroke objects in it.
This is changing in 0.9.5, because the current code doesn't work that well for combined or dual axis charts.
Regards,
Dave Gilbert
This is changing in 0.9.5, because the current code doesn't work that well for combined or dual axis charts.
Regards,
Dave Gilbert