Is it possible to show last data labels in the series line chart

0

Hi, 

I am using Jasperserver Commerical edition and Jaspersoft Studio professional edition, the issue I am facing currently is that in my report I am using Series line chart and there is a requirement of datalabels for the end points of each series. Things which I have already tried are - 

1. Using the datalabel option under plotoptions and if I set it as TRUE then I am getting datalabels for all the points which is not needed.

2. I have tried using a javascript callback function in the datalabel formatter but it did not worked.

 

Please let me know if there is a way to achive it.

Thing I am trying to achieve is 

 

 

Hoping fo a speedy reply.

 

Thanks,

Ankur Gupta

ankur.gupta.aug@gmail.com

Ankur Gupta's picture
Joined: Jan 21 2013 - 10:36pm
Last seen: 3 months 2 days ago

1 Answer:

0

This seems to be working using following plotOptions.series.dataLabels.formatter:

function() { var len = this.series.data.length; if(this.point.x == len-1) {return this.point.y;} else return null;}

Attached sample can be run with any DB

Attachments: 
AttachmentSize
html5_line_datalabels.jrxml4.47 KB
dnaboka's picture
62
Joined: Jun 8 2012 - 1:18am
Last seen: 1 week 7 hours ago
Feedback
randomness