Community
Participate
Working Groups
Created three ColorDefinition for green, red and yellow as below: List fills = new ArrayList(); fills.add(ColorDefinitionImpl.create(0, 255, 0)); fills.add(ColorDefinitionImpl.create(255, 0, 0)); fills.add(ColorDefinitionImpl.create(255, 255, 0)); SeriesDefinition sd = SeriesDefinitionImpl.create(); pie.getSeriesDefinitions().add(sd); sd.getSeriesPalette().update( 0 ); sd.getSeriesPalette().getEntries().addAll(fills); The pie chart comes up with its colors not as expected. Especially green collor look blue. See attachment.
Created attachment 36287 [details] pie chart set with green red, and yellow colors
If you want to replace the default palette, the code should look like this: SeriesDefinition sd = SeriesDefinitionImpl.create(); pie.getSeriesDefinitions().add(sd); //sd.getSeriesPalette().update( 0 ); sd.getSeriesPalette().clear(); //This would cleanup the internal default palette. sd.getSeriesPalette().getEntries().addAll(fills);
Okay, it's really sd.getSeriesPalette().getEntries().clear(); that does the work. There's no clear() function on Palette. Closing this defect.