Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Changing color of Bar chart
edan
Is it possible to change the color of the bar chart based on data?
Find more posts tagged with
Comments
johnw
Would changing the Palette selection based on Value series instead of Category work for you? This is under the Chart Editor/Format/Series section.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'edan'" data-cid="65743" data-time="1276896515" data-date="18 June 2010 - 02:28 PM"><p>
Is it possible to change the color of the bar chart based on data?<br /></p></blockquote>
edan
I have accomplished my requirements by firing a script during the rendering of the chart.
//To show correct colors for all sections of the Bar chart. The color will be based on the Category.
function beforeDrawDataPoint( dph, fill, icsc )
{
var sValue = dph.getDisplayValue();
if (sValue.contains("1CPTP"))
{
fill.set(148, 198, 222);
}
}
jain
Hi Is it possible to set the dataset value of RGB color dynamically? instead of doing
if (sValue.contains("1CPTP"))
{
fill.set(148, 198, 222);
}
I want something like below,
colorVal = (148, 198, 222);
if (sValue.contains("1CPTP"))
{
fill.set(colorVal);//dynamically
}
kclark
jain I haven't tried it but I think you should be able to do what you're trying using persistent global variables in you're report. You could create three say r, g, and b. And set the values somewhere else in a function you create and call them in your beforeDrawDataPoint() making it dynamic.
jain
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="112986" data-time="1357332296" data-date="04 January 2013 - 01:44 PM"><p>
jain I haven't tried it but I think you should be able to do what you're trying using persistent global variables in you're report. You could create three say r, g, and b. And set the values somewhere else in a function you create and call them in your beforeDrawDataPoint() making it dynamic.<br /></p></blockquote>
Thanks Kclark,let me try it out and reply back