Rounding results in highcharts jquery script

后端 未结 6 1352
庸人自扰
庸人自扰 2021-02-07 04:20

I know this is a bit out there... but gonna ask anyways. I\'m using highcharts jquery script (http://www.highcharts.com/) to generate a pie chart. I am trying to round off the n

6条回答
  •  春和景丽
    2021-02-07 04:42

    In in the tooltip option in the configuration object use Math.round() in the formatter function.

       tooltip: {
         formatter: function() {
            return ''+ this.point.name +': '+ Math.round(this.percentage) +' %';
         }
      },
    

提交回复
热议问题