Jump to content
JasperReports 7.0 is now available ×

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


Ankur Gupta

Recommended Posts

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 

 

 Capture(69).PNG.ee44323cafaa648d26f097a4bbae1b26.PNG

Hoping fo a speedy reply.

 

Thanks,

Ankur Gupta

ankur.gupta.aug@gmail.com

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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;}[/code]

Attached sample can be run with any DB

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...