hello, I have problem.
Envirement:
- I create JFreechart useing 'StandardXYItemRenderer', 'XYPlot'.
- SeriesPaint is auto genaration.
- Series count is dynamic. it could be more 50.
Problem:
- Yellow Series is high brightness. User hard to see the yellow series(third series).
I tried:
- Plot background change the row bightness but User don't want to change(for excel export.).
- serSeriesPaint(ex> renderer.setSeriesPaint(3, Color.Blue) ) but next series is yellow. Can't exclude high brightness yellow.
- Googling suggest 'DrawingSupplier but I can't know how to make DrawingSupplier.
please reply.
exclude high brightness yellow series.
-
- Posts: 2
- Joined: Sat Jul 28, 2012 2:25 pm
- antibot: No, of course not.
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: exclude high brightness yellow series.
I usually just override getItemPaint(), as discussed here, but replacing the DrawingSupplier seems like a more general solution. The default drawing supplier is owned by Plot. Starting from TimeSeriesChartDemo1, here's a minimal example:


Code: Select all
plot.setDrawingSupplier(new DrawingSupplier() {
@Override
public Paint getNextPaint() {
return Color.blue;
}
@Override
public Shape getNextShape() {
return ShapeUtilities.createDiamond(4f);
}
@Override
public Stroke getNextStroke() {
return new BasicStroke();
}
// ...
});
Re: exclude high brightness yellow series.
What I did is something like this:
hth,
- martin
Code: Select all
final Paint[] paintArray;
// create default colors but modify some colors that are hard to see
paintArray = ChartColor.createDefaultPaintArray();
paintArray[2] = new Color(0x00, 0xBB, 0x00);
paintArray[3] = new Color(0xEE, 0xAA, 0x00);
plot.setDrawingSupplier(new DefaultDrawingSupplier(
paintArray,
DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
- martin