Jump to content
We've recently updated our Privacy Statement, available here ×
  • HTML5 Charts custom formatting: how to split the value with commas and decimal point.


    akonkin
    • Features: Charts Product: JasperReports® Library

    [toc on_off::hide=1]

    Question:

    I would like to split numeric value with decimal point, two digits should be shown after the decimal point.

    How to apply this for Tooltips and Labels?


    Answer:

    You can achieve the desired result by applying custom formatting function for Tooltips and Labels by defining this function in the Advanced Chart Properties

    (plotOptions.series.dataLabels.formatter and tooltip.formatter properties):

    2016-06-13_1151_1.png.7a20fd9f9ecf6c4b63135579d88c3f0c.png

    Below I quote a text of the sample of custom formatting function:

    function() { return   this.series.name  +"<br/>"+ this.x +"<br/>"+Highcharts.numberFormat(this.y, 2) ;}
    

    However there is an easier way to achieve this in case of tooltips.  You just need to specify the number of digits after the comma in the tab that is shown below (Tooltip->Value Decimals = 2):

    2016-06-13_1151_2.png.ad565994fb5cf5201b2869c6faa4b36b.png

    2016-06-13_1151_1.png.4d54437d5e341733648b4f219b63a700.png

    2016-06-13_1151_2.png.741524408e5170139288d5ef07ad279a.png

    case_51644_tooltip_formatting_and_label_formatting_10062016.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...