Highchart,如何在工具提示中为逗号数据添加逗号

时间:2017-06-26 20:32:52

标签: highcharts

我的Highchart工具提示格式如下:

$(function() {
   Highcharts.setOptions({
      chart: {
            style: {
                fontFamily: "Trebuchet MS"
            }
        },
       lang: {
           thousandsSeparator: ','
       }
   });

   // plot the chart
   new Highcharts.Chart({
        chart: {
            renderTo: 'graphContainer',
            type: 'area',
            marginBottom: 110
        },

        tooltip: {
            shared: true,
            xDateFormat: '%Y-%m-%d',
            headerFormat: '<b>{point.key}</b><br>',
            pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>${point.y:,.0f} m</b><br/>',
            crosshairs: true
        },
  ......

我知道“:,。0f”控制数字的格式,但我无法弄清楚如何在数千位而不是“”空格中添加“,”。

enter image description here

1 个答案:

答案 0 :(得分:0)

我认为这个问题是一个错字。全局应为thousandsSep而不是thousandsSeparator,如API docs中所述。

相关问题