Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Changing Bar colors dynamically on a Chart
suma
Hi All,
I have created a report with Bar chart,now i need to change the color of the bar dynamically,suppose i have a threshold of 94 .if my series value is greater than 94 bar color will be green,if it is equal to 94 bar color is orange otherwise it should be in red, will it possible to do the same?
Thanks,
Suma
Find more posts tagged with
Comments
mwilliams
Laz,
Here's the report design I modified to do this. It still has a little ways to go. I believe that this just runs off of your XML source file. Let me know if you have issues and I'll describe better what I did. In the report, I think I modified the PFT chart, not the Ruck chart, but hopefully you'll get the idea.
This is the one I did yesterday that I tried to describe in my last post.
Lazarus33
Michael,<br />
<br />
This is PERFECT!! I took a look at your rptdesign file and was able to modify it for my Ruck chart as opposed to the PFT chart. The only thing I have left to do is try and show the actual score as a label instead of showing "240" if it does go above that.<br />
<br />
Do you know of any way that I can modify the Series 1 expression for Value (Y) Series to show the actual score regardless of whether or not it's above 240? Here's the code you used there:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (row["Ruck-Score"] > 240){
240
}
else{
row["Ruck-Score"]
}</pre>
<br />
I tried modifying this and even went as far as creating another computed column called "TotalRuck" that was row["OverRuckTimeStandard"] + 240 and tried this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (row["Ruck-Score"] > 240){
row["TotalRuck"]
}
else{
row["Ruck-Score"]
}</pre>
<br />
That didn't work correctly, unfortunately. But if I can get that label to show up as the actual "Ruck-Score" value regardless of whether or not it goes over 240 then I am there! (see attached screenshot) So close....this is so awesome, though - thank you!!<br />
<br />
And again, I've attached the updated rptdesign file and the XML Data Source if you have a chance to take a crack at it. Thanks again for everything - I'm learning so much more about BIRT through your examples!<br />
<br />
-Laz
mwilliams
Laz,
Give this a whirl. Let me know.
Lazarus33
BINGO!!
Michael, you are the man!! I see what you did looking at the code for the chart as well, which makes perfect sense now.
Thank you SO MUCH for taking the time to help me out on this - this is a HUGE win for us! And it's also amazing to see what all I have to learn regarding BIRT, and now I look forward to it.
Thanks again for your help - you are greatly appreciated my friend!
-Laz
mwilliams
Laz,
No problem.
Just let us know if you have any questions.