<p>I want to set the colors on my bar chart's Optional Grouping data element. I've come across numerous examples that tell me to paste the <span style="color:#800080;">beforeDrawDataPoint( dph, fill, icsc )</span> function into my script page for the the chart. This does not seem to work in BDPro. This function is now moved into the Client Script section of the Chart and uses totally different methods. I borrowed the example below from <span style="color:#800080;"><a data-ipb='nomediaparse' href='
http://martinhammer.com/blog/?p=575'>http://martinhammer.com/blog/?p=575</a></span> because it provides the clearest explanation of what I want to do, I just need some help in doing it in BDPro.</p>
<p> </p>
<p>Thanks</p>
<p> </p>
<p>
</p>
<p> </p>
<p><span style="color:#800080;">For example, in the chart below “High†is represented in green, “Mid†in orange and “Low†in red.</span></p>
<p style="text-align:center;"><span style="color:#800080;"><img src="
http://www.martinhammer.com/blog/wp-content/uploads/2010/09/barchart_01.png" title="Stacked bar chart" alt="barchart_01.png"></span></p>
<p style="text-align:left;"><span style="color:#800080;">However, if for a particular dataset one of the of category values is not present, the palette colours are still used in the same order, meaning the “Mid†area is now shown as red and “High†as orange. This is confusing for the end user:</span></p>
<p style="text-align:center;"><span style="color:#800080;"><img height="160" src="
http://www.martinhammer.com/blog/wp-content/uploads/2010/09/barchart_02.png" title="Stacked bar chart" width="530" alt="barchart_02.png"></span></p>
<p style="text-align:left;"><span style="color:#800080;">As in the previous examples, we solve this problem by adding a little bit of script to override the chart’s default behaviour.</span></p>
<p style="text-align:left;"> </p>
<p style="text-align:left;"><span style="color:#800080;">function beforeDrawDataPoint( dph, fill, icsc )<br>
{<br>
var sValue = dph.getSeriesDisplayValue();<br>
// set( R, G, B, alpha )<br>
if( sValue == "1-Low" )<br>
{<br>
fill.set( 242, 88, 106, 255 );<br>
}<br>
else if( sValue == "2-Mid" )<br>
{<br>
fill.set( 232, 172, 57, 255 );<br>
}<br>
else if( sValue == "3-High" )<br>
{<br>
fill.set( 128, 255, 128, 255 );<br>
}<br>
}</span></p>
<p style="text-align:left;"> </p>
<p style="text-align:left;">
</p>