Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 131834 - SWT Pie Chart: Colors are off
Summary: SWT Pie Chart: Colors are off
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Birt-Chart-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 103549
  Show dependency tree
 
Reported: 2006-03-14 17:14 EST by Bianca Jiang CLA
Modified: 2006-03-15 16:41 EST (History)
0 users

See Also:


Attachments
pie chart set with green red, and yellow colors (10.07 KB, image/jpeg)
2006-03-14 17:25 EST, Bianca Jiang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bianca Jiang CLA 2006-03-14 17:14:03 EST
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.
Comment 1 Bianca Jiang CLA 2006-03-14 17:25:53 EST
Created attachment 36287 [details]
pie chart set with green red, and yellow colors
Comment 2 Zhiqiang Qian CLA 2006-03-14 21:05:50 EST
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);
Comment 3 Bianca Jiang CLA 2006-03-15 16:41:42 EST
Okay, it's really

sd.getSeriesPalette().getEntries().clear();

that does the work. There's no clear() function on Palette.

Closing this defect.