Home » Archived » BIRT » Custom Color/Gradient Palette definition through DE API
Custom Color/Gradient Palette definition through DE API [message #783522] |
Wed, 25 January 2012 17:00  |
Eclipse User |
|
|
|
Hello,
I am generating a report using the DE API (BIRT 3.7.1) but i am stuck at customizing the Palette used by my PieGraph.
The only way i have found to manage the color palette is through the following code:
SeriesDefinition segroup = SeriesDefinitionImpl.create();
segroup.getSeriesPalette().update(0);
I can only update(int) or shift(int) the Palette!
I need to specify the colors to be used in my Palette for my pieChart as well as specify through DE API some gradients for each palette entry.
Any luck that somebody might know how to do this?
Many thanks,
Best Regards,
Jean-Baptiste
|
|
|
Re: Custom Color/Gradient Palette definition through DE API [message #783874 is a reply to message #783522] |
Thu, 26 January 2012 11:18  |
Eclipse User |
|
|
|
Try:
segroup.getSeriesPalette( ).getEntries( ).clear( );
segroup.getSeriesPalette().getEntries().add( GradientImpl.create(
ColorDefinitionImpl.create(220,237,248),
ColorDefinitionImpl.create(80,166,218), 0, false));
segroup.getSeriesPalette().getEntries().add( GradientImpl.create(
ColorDefinitionImpl.create(255,213,213),
ColorDefinitionImpl.create(242,88,106), 0, false));
segroup.getSeriesPalette().getEntries().add( GradientImpl.create(
ColorDefinitionImpl.create(255,247,213),
ColorDefinitionImpl.create(232,172,57), 0, false));
segroup.getSeriesPalette().getEntries().add( GradientImpl.create(
ColorDefinitionImpl.create(213,255,213),
ColorDefinitionImpl.create(128,255,128), 0, false));
segroup.getSeriesPalette().getEntries().add( GradientImpl.create(
ColorDefinitionImpl.create(213,255,255),
ColorDefinitionImpl.create(64,128,128), 0, false));
segroup.getSeriesPalette().getEntries().add( GradientImpl.create(
ColorDefinitionImpl.create(226,226,241),
ColorDefinitionImpl.create(128,128,192), 0, false));
Jason
On 1/25/2012 5:00 PM, jeanbaptiste.guillois wrote:
> Hello,
>
> I am generating a report using the DE API (BIRT 3.7.1) but i am stuck at
> customizing the Palette used by my PieGraph.
>
> The only way i have found to manage the color palette is through the
> following code:
>
> SeriesDefinition segroup = SeriesDefinitionImpl.create();
> segroup.getSeriesPalette().update(0);
>
> I can only update(int) or shift(int) the Palette! I need to specify the
> colors to be used in my Palette for my pieChart as well as specify
> through DE API some gradients for each palette entry.
>
> Any luck that somebody might know how to do this?
>
> Many thanks,
>
> Best Regards,
>
> Jean-Baptiste
|
|
|
Goto Forum:
Current Time: Mon Jul 07 14:17:53 EDT 2025
Powered by FUDForum. Page generated in 0.06962 seconds
|