Hi, I'm trying to add a visible border to each data series in an area chart, but can't get it to work. The borders are simply ignored. This code works for bar charts. Any ideas?
Here's what I'm trying:
JFreeChart chart = < an area chart with a CategoryDataset >;
CategoryPlot plot = chart.getCategoryPlot();
CategoryItemRenderer renderer = plot.getRenderer();
Stroke[] seriesStrokes = new Stroke[] {... a populated Stroke array ...};
Paint[] seriesOutlinePaints = new Paint[] {... a populated Paint array ...};
for (int i=0; i < seriesStrokes.length; i++) {
renderer.setSeriesStroke(i,seriesStrokes);
}
if (renderer instanceof AbstractRenderer) {
AbstractRenderer abstractRenderer = (AbstractRenderer)renderer;
for (int i=0; i < seriesOutlinePaints.length; i++) {
abstractRenderer.setSeriesOutlinePaint(i,seriesOutlinePaints);
}
}
setting series stroke for area charts
Re: setting series stroke for area charts
I think the area renderer doesn't use outlines at all, so you might need to look at modifying the drawing code in the renderer.
Regards,
Dave Gilbert
Regards,
Dave Gilbert