views:

45

answers:

2

I'd like to use a different LineAndShapeRenderer for each series on a JFreeChart TimeSeries graph. Has anyone accomplished this before? It seems the Renderer is owned by the Plot where each JFreeChart has a single Plot object hence the rendering is applicable to all series rather than individual ones.

+3  A: 

I have not tried a case like that. However, I have changed the rendering properties of an specific Series with:

// chart is a JFreeChart object
XYItemRenderer renderer = chart.getXYPlot().getRenderer();
renderer.setSeriesStroke(index, new BasicStroke(DEFAULT_LINE_WIDTH));
                        renderer.setSeriesPaint(/* index of series */, /*some color*/);
YuppieNetworking
If my answer is correct, would you mind accepting it? Thank you... (people are more motivated to answer your questions when your acceptance rate is high. Yours is zero for the moment. Also, that gives you reputation as well)
YuppieNetworking
+1  A: 

Thanks very much, there is a similar method for the shape of a series:

XYItemRenderer renderer = chart.getXYPlot().getRenderer();
renderer.setSeriesShape(int series, java.awt.Shape shape) 
James