smimar1074
smimar1074

Reputation: 1

HighCharts - round the mean value on bellcurve

How can I display only 3 digits after comma on the bell curve for both mean and standard deviation? On the chart itself.

This is what I have done. It works for the standard deviation but not for the mean. I couldn't figure out the issue.

tooltip: {
shared: true,
useHTML: true,
headerFormat: '<table><tr><th colspan="2">MEAN</th></tr>',
pointFormat: '<tr><td style="color: {series.color}">{series.name} </td>' +
'<td style="text-align: right"><b>{point.x} </b></td></tr>',
footerFormat: '</table>',
valueDecimals: 3
},

Thanks,

Upvotes: 0

Views: 98

Answers (1)

ppotaczek
ppotaczek

Reputation: 39139

You can use {point.x} with numeric formatting in pointFormat, for example {point.x:.3f}.

  tooltip: {
    pointFormat: '<tr><td style="color: {series.color}">{series.name} </td>' +
      '<td style="text-align: right"><b>{point.x:.3f} </b></td></tr>',
    ...
  }

Live demo: https://jsfiddle.net/BlackLabel/5cmpwkzy/

API Reference: https://api.highcharts.com/highcharts/tooltip.pointFormat

Upvotes: 0

Related Questions