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



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.



Ankur Gupta

Ankur Gupta's picture
Joined: Jan 21 2013 - 10:36pm
Last seen: 4 weeks 1 day ago

1 Answer:


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

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

Attached sample can be run with any DB

html5_line_datalabels.jrxml4.47 KB
dnaboka's picture
Joined: Jun 8 2012 - 1:18am
Last seen: 13 hours 59 min ago