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)
Dynamically change max bar color
shamo
How do i make the maximum bar in a bar chart red and rest blue. Value for maximum is dynamic. Thank you
Find more posts tagged with
Comments
Clement Wong
<p>Are you still using commercial BIRT with HTML5 charts? If so, add code to determine the max value in the <em>beforeDrawSeries </em>event, and in the <em>beforeDrawDataPoint </em>event, change the color when we reach that particular point.</p>
<p> </p>
<p>Attached is an example.</p>
<pre class="_prettyXprint _lang-">
beforeDrawSeries: function(series, seriesOptions, chart, seriesIndex)
{
maxIndex = series.processedYData.indexOf(series.dataMax);
},
beforeDrawDataPoint: function(point, pointOptions, chart, seriesIndex, pointIndex)
{
if ( pointIndex == maxIndex ) {
pointOptions.color = 'maroon';
}
},
</pre>
shamo
<p>Thank you Clement.</p>