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)
Bar Chart Color Palette Order
kpelzer29
I have several bar charts that are related and I would like to use the same color scheme for each <strong class='bbc'>Y Series</strong> value in the chart. The user would then be able to associate a color with a consistent <strong class='bbc'>Y Series Grouping</strong> value. I have the order of the colors in the Series Palette match for each of the charts. The problem I am having is if one chart does not have data for one of the <strong class='bbc'>Y Series Grouping</strong> values, the color order does not not change and it throws off the color association in the Series Palette for that specific chart. The value each color represents after that does not match the other charts. Is there a way I can make sure the color I would like associated with each value in several charts does not change, even if one chart does not have data for one of the <strong class='bbc'>Y Series Grouping</strong> values?
Find more posts tagged with
Comments
mwilliams
You could define the colors for each bar in script depending on your category data.
thuston
Modify your query(ies) to always return all the same categories, even if one has a 0 value.
kpelzer29
That's a good idea. I am using a computed column to create the categories. Is there a way I can return all the same categories, even if one has a 0 value, if I am using a computed column?<br />
<br />
<blockquote class='ipsBlockquote' data-author="'thuston'" data-cid="73360" data-time="1297779532" data-date="15 February 2011 - 07:18 AM"><p>
Modify your query(ies) to always return all the same categories, even if one has a 0 value.<br /></p></blockquote>
kpelzer29
Thank you. I saw in an earlier post you put:<br />
<br />
function beforeDrawDataPoint(dph, fill, icsc)<br />
{<br />
if (dph.getSeriesDisplayValue() == "blah"){<br />
fill.set(255,0,0);<br />
}<br />
}<br />
<br />
I incorporated this code with the data I am using and it changed the color for the bar in the chart. I had to add additional code to set the same color in the legend.<br />
<br />
function beforeDrawLengendItem(lerh, bounds, icsc)<br />
{<br />
label = lerh.getLabel();<br />
labelString = label.getCaption().getValue();<br />
if (labelString == "blah"){<br />
lerh.getFill().set(255,0,0);<br />
}<br />
}<br />
<br />
Is this what you would recommend?<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="73319" data-time="1297719701" data-date="14 February 2011 - 02:41 PM"><p>
You could define the colors for each bar in script depending on your category data.<br /></p></blockquote>
thuston
Yes.
If you know the category values you want matched to a color then that Chart script is a good solution.
mwilliams
Yes, that is what I would do if you want consistent coloring across all of your charts no matter the data they have in them and you know all the categories.