Hiya
I've constructed multiple series chart. Instead of using different colour to indicate various series, can I show them in, say solid line, dotted line etc ???
Thanks very much!!!
Moshea
Different line styles in a multple series chart
Re: Different line styles in a multple series chart
In 0.9.4, you can use the setSeriesStroke(...) method that all plots inherit from the Plot class. Supply an array of Stroke objects, and the plot will cycle through the array as it processes each series. The array can be any length, it returns to the start if necessary.
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: Different line styles in a multple series chart
Heres an example of what Dave mentioned...although I still have another question about this.
// set the stroke for each series...
Stroke[] seriesStrokeArray = new Stroke[6];
seriesStrokeArray[0] = new BasicStroke(2.0f);//straight line
seriesStrokeArray[2] = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,1.0f, new float[] { 2.0f, 6.0f }, 0.0f);
seriesStrokeArray[3] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,1.0f, new float[] { 10.0f, 6.0f }, 0.0f);
seriesStrokeArray[4] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,1.0f, new float[] { 6.0f, 6.0f }, 0.0f);
seriesStrokeArray[5] = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,1.0f, new float[] { 2.0f, 6.0f }, 0.0f);
but can I visually represent these lines ????IN THE LEGEND?????
// set the stroke for each series...
Stroke[] seriesStrokeArray = new Stroke[6];
seriesStrokeArray[0] = new BasicStroke(2.0f);//straight line
seriesStrokeArray[2] = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,1.0f, new float[] { 2.0f, 6.0f }, 0.0f);
seriesStrokeArray[3] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,1.0f, new float[] { 10.0f, 6.0f }, 0.0f);
seriesStrokeArray[4] = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,1.0f, new float[] { 6.0f, 6.0f }, 0.0f);
seriesStrokeArray[5] = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,1.0f, new float[] { 2.0f, 6.0f }, 0.0f);
but can I visually represent these lines ????IN THE LEGEND?????
Re: Different line styles in a multple series chart
David,
What's happened with the 0.9.4 Plot.setSeriesStroke(...) method? I try to upgrade to 0.9.5 but I am experiencing troubles with this.
Thanks in advance,
Sjakie Glas
What's happened with the 0.9.4 Plot.setSeriesStroke(...) method? I try to upgrade to 0.9.5 but I am experiencing troubles with this.
Thanks in advance,
Sjakie Glas
Re: Different line styles in a multple series chart
All the renderers now inherit setSeriesStroke(...) methods from AbstractRenderer.
Regards,
Dave Gilbert
Regards,
Dave Gilbert