Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT Report Designer: Setting color of bars in a bar chart by using a specific value
BIRT Report Designer: Setting color of bars in a bar chart by using a specific value [message #1594895] Sat, 31 January 2015 16:18 Go to next message
Frank Dullweber is currently offline Frank DullweberFriend
Messages: 1
Registered: January 2015
Junior Member
Hi all

I have a table like:

Category_X, Group_X, Value_Y
A, G1, 1.234
B, G1, 65.666
C, G2, 54.78
D, G2, 45.67
E, G3, 12.43
.....

I have already generated a bar chart with BIRT Report Designer that uses Category_X for the x axis und Value_Y for the y axis. What is missing is the following:

I want to color the bar based on the Group_X value. In pseudo code:
if group = G1 then color_of_bar = red,
if group = G2 then color_of_bar = blue,
....

Can anyone help how the insert that into my report generated in Report Designer? Is it a line of code that I can enter at a "specific position"?

Best, Frank
Re: BIRT Report Designer: Setting color of bars in a bar chart by using a specific value [message #1601294 is a reply to message #1594895] Wed, 04 February 2015 21:34 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Here is one way. In the data set onFetch script, set a Persistent Global Variable named after the category field with a value of the group field. In the chart script, access this PGV and compare it to the category value to determine the color you should shade the bar. You'll just need to create an external legend for the chart so your users know what the colors mean.

Michael

Developer Evangelist, Silanis
Previous Topic:Need help on BIRT app viewer
Next Topic:Difference in PDF output
Goto Forum:
  


Current Time: Mon Jul 22 14:36:05 GMT 2024

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

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

Back to the top