Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Custom Color/Gradient Palette definition through DE API
Custom Color/Gradient Palette definition through DE API [message #783522] Wed, 25 January 2012 22:00 Go to next message
Jean-Baptiste Guillois is currently offline Jean-Baptiste GuilloisFriend
Messages: 33
Registered: August 2011
Member
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 16:18 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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
Previous Topic:The viewing session is not available or has expired
Next Topic:Item expand to page break
Goto Forum:
  


Current Time: Sun Nov 23 03:41:00 GMT 2014

Powered by FUDForum. Page generated in 0.03670 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software