I have created my own renderers by extending the default renderers, so that I can set my own colours, and shapes.
The problem I am having is that when I use the Overlaid..Plot, the Legend just shows red squares, even though I have no red objects on the chart at all.
Is there a way around this ?
Mof.
BTW great work with 0.9.5 & 0.9.6!!
Legend in OverlaidVerticalCategoryPlot
Re: Legend in OverlaidVerticalCategoryPlot
Hello,
The default shapes and colors come from : com.jrefinery.chart.renderer.DefaultDrawingSupplier.createStandardSeriesShapes()
and com.jrefinery.chart.ChartColor.createDefaultPaintArray().
It is possible to set Your own shapes for a series with :
com.jrefinery.chart.renderer.AbstractRenderer.setSeriesShape(int dataset, int series, Shape shape)
for an example, look in TimeSeriesDemo9 :
"[...]
StandardXYItemRenderer renderer = (StandardXYItemRenderer) r;
renderer.setPlotShapes(true);
renderer.setDefaultShapeFilled(true);
renderer.setSeriesShape(0, new Ellipse2D.Double(-3.0, -3.0, 6.0, 6.0));
renderer.setSeriesShape(1, new Rectangle2D.Double(-3.0, -3.0, 6.0, 6.0));
[...]"
and for the paint, as You've guessed, use the setSeriesPaint(int series, Paint paint) method.
Regard,
Arnaud
The default shapes and colors come from : com.jrefinery.chart.renderer.DefaultDrawingSupplier.createStandardSeriesShapes()
and com.jrefinery.chart.ChartColor.createDefaultPaintArray().
It is possible to set Your own shapes for a series with :
com.jrefinery.chart.renderer.AbstractRenderer.setSeriesShape(int dataset, int series, Shape shape)
for an example, look in TimeSeriesDemo9 :
"[...]
StandardXYItemRenderer renderer = (StandardXYItemRenderer) r;
renderer.setPlotShapes(true);
renderer.setDefaultShapeFilled(true);
renderer.setSeriesShape(0, new Ellipse2D.Double(-3.0, -3.0, 6.0, 6.0));
renderer.setSeriesShape(1, new Rectangle2D.Double(-3.0, -3.0, 6.0, 6.0));
[...]"
and for the paint, as You've guessed, use the setSeriesPaint(int series, Paint paint) method.
Regard,
Arnaud
Re: Legend in OverlaidVerticalCategoryPlot
I already do this, but my problem is that the legend didn't seem to be picking up my changes.
Mof.
Mof.