BIRT Exchange Forum: Change series color in Chart - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Change series color in Chart Rate Topic: -----

#1 User is offline   sirim Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 41
  • Joined: 29-February 12


Posted 23 March 2012 - 12:01 PM

Hello Everyone,

I am generating a bar chart which has 3 different series, I need to change the color of the bars. How can I do this is BIRT is there a way?

Thank you for the help!!

Regards
0

#2 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12971
  • Joined: 16-May 08


Posted 23 March 2012 - 12:44 PM

In your chart editor, under the format chart tab, click on Series. Then, click on the chart palette button at the bottom. You can set the chart palette colors to whatever colors you want. If you need it more dynamic, like certain color for a certain series, you can use the beforeDrawDataPoint function in your chart script and use code like:

if (dph.getSeriesDisplayValue() == "Series 1"){
fill.set(255,0,0);
}
else if (dph.getSeriesDisplayValue() == "Series 2"){
fill.set(0,255,0);
}
else{
fill.set(0,0,255);
}

I think this is right. If not, it's close. I just didn't double check in the actual script area to see if it was 100% correct. :)
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users