Functions can be used to format html5 datalabels and tooltips

Issue Description:

Html5 chart Tooltips values can be formatted using highchart's functions.  Following is an example of such tooltip formatting directly via javascript calls (unrelated to JasperReports Server):


Since JasperReports Server version 5.1, you can take advantage of these highcharts functions to impact things like tooltips as well as datalabels.

First, add this line to \WEB-INF\classes\ and restart the server:

Then specify javascript function as strings within your expressions for advanced properties, like tooltip.formatter or plotOptions.pie.dataLabels.formatter. The resulting jrxml would be like:

<hc:chartProperty name="plotOptions.pie.dataLabels.formatter">
      <![CDATA["function() {return '<b>something bold</b>: '+this.point.y;}"]]>
<hc:chartProperty name="tooltip.formatter">
      <![CDATA["function() {return 'something with percent char: '+this.point.y+'%';}"]]>

Sample jrxml attached using sugarcrm datasource.

Note that JasperReports Server v5.5 contains a bug (35210 ) which effects the behavior of these functions. The cumulative hotfix patch for JasperReports Server v5.5, available upon request from support, will resolve the bug (note that hotfixes are available for customers with Premiun Subscription only).


Ref. Case #00034325