简体   繁体   中英

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,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM