I am creating a combined chart, where the first chart contains a number of datapoints, represented by minutes over time.
The next charts are created based on the same datapoints, used at the first chart, but in percent over time, and a chart for every datapoint.
My problem is, to get the series paint from every datapoint in the first chart, and create the next charts, with the same color as used for the same datapoint in the first chart.
I have tryed to use getSeriesPaint, but it returns nothing, unless i manually have set the seriespaint for every datapoint in the first chart.
Is it not possible to get the color used, unless the color is manually set ?
Hope this is not to confusing.
getseriespaint
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
How *do* you specify the colours for the first chart?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
There's one other subtlety to consider. The auto-population of the series paint attributes happens during the time the chart is first *drawn*. So if you haven't drawn your chart anywhere yet, there will be no series paint values to look-up in the renderer.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The colours are defined in the ChartColor class. The ChartColor.createDefaultPaintArray() method is called by the DefaultDrawingSupplier class to initialise the DEFAULT_PAINT_SEQUENCE. And that's where the renderer will get its colours from unless you configure it differently.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

