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)
To display only First and last label in a series of bar chart
RRK
<p>How to display only first and last label in a series of bar chart.</p>
<p> </p>
<p>Suppose a country has credit limits 10,20,30,40.So chart should build the bars for 10,20,30,40 but above first and last bar only the labels for the same should be displayed as 10 and 40 (hide 20,30).</p>
<p> </p>
<p>Is there a property ShowFirstLabel and ShowLastLabel which we can set to true which will show only first label and last label for a series and hide other labels ?</p>
<p> </p>
<p>I am using Actuate BIRT analytics designer 4.4.0</p>
<p> </p>
<p>Thanks in advance.</p>
Find more posts tagged with
Comments
Clement Wong
<p>There isn't a property but you can easily do it with a script in the <em>beforeDrawDataPoint </em>event.</p>
<pre class="_prettyXprint">
beforeDrawDataPoint: function(point, pointOptions, chart, seriesIndex, pointIndex)
{
if ( (pointIndex == 0) || (pointIndex == (chart.getCore().series[0].data.length - 1)) ) {
chart.getCore().series[0].data[pointIndex].dataLabels = {enabled:true, color: 'red'};
}
},</pre>
<p>Other options to format the dataLabel can be found here @ <a data-ipb='nomediaparse' href='
http://api.highcharts.com/highcharts#plotOptions.series.dataLabels'>http://api.highcharts.com/highcharts#plotOptions.series.dataLabels</a></p>
;
<p> </p>
<p>Attached is an example.</p>
<p> </p>