简体   繁体   English

高图:工具提示中的有效小数

[英]Highcharts: significant decimals in the tooltip

I am trying to change the number of significant decimals. 我正在尝试更改有效的小数位数。 By default is 7, so I am having many 0.0000000s for values smaller than 0.0000001. 默认情况下是7,所以对于小于0.0000001的值,我有很多0.0000000。

I tried plotOptions.series.dataLabels.formatter and plotOptions.line.dataLabels.formatter , but they didn't work. 我尝试了plotOptions.series.dataLabels.formatterplotOptions.line.dataLabels.formatter ,但是它们没有用。

Then, I tried plotOptions.line.tooltip.formatter but this only accepts HTML, and I'd like to set something like 然后,我尝试了plotOptions.line.tooltip.formatter但这只接受HTML,我想设置类似

function() {
    return Highcharts.numberFormat(this.y,10);
}

I run example with 20 decimal, see example http://jsfiddle.net/qPUZw/ 我使用20位小数来运行示例,请参见示例http://jsfiddle.net/qPUZw/

 tooltip:{
            formatter:function(){
            return Highcharts.numberFormat(this.y,20,',')
            }
        },

Seems to working fine. 似乎工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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