Just noticed that when I have so many categories the colours on the bars repeat them selves.
anyone else has a simular problem? and how does one change this without specifying every single colour.
Default Colours
Crate your own instance of a class that implements
Then call
and pass in your new class
Code: Select all
org.jfree.chart.plot.DrawingSupplier
Code: Select all
plot.setDrawingSupplier(...)
Or even simpler: create your own DrawingSupplier like this:
And set it like skunk wrote above. This way you don't have to implement the whole interface.
hth,
- martin
Code: Select all
new DefaultDrawingSupplier(
new Paint[] {
new Color(0x55, 0x55, 0xFF),
new Color(0x55, 0xFF, 0xFF),
... },
DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
hth,
- martin
hi, I have a problem with this code.... I do that, but the colors always are red, blue,green.... as the default sequence.
my code : (where jfc is a correctly create JFreeChart)
four hours that i try some differents ways but no results
please, some help would be welcome
my code : (where jfc is a correctly create JFreeChart)
Code: Select all
jfc.getPlot().setDrawingSupplier(new DefaultDrawingSupplier(
new Paint[] {Color.ORANGE,Color.green},
new Paint[] {Color.darkGray},
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE)
);

please, some help would be welcome
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You have to be sure to set the drawing supplier *before* the chart is drawn for the first time, because it only consults the drawing supplier once and after that it uses the cached values.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

