Reputation: 1
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
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