最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - highcharts - precision for stacked column chart data labels - Stack Overflow

programmeradmin2浏览0评论

we are using highcharts and are trying to use stacked charts, but running into some issues. See the following fiddle:

/

I'm able to display the number to a given precision, however the data labels (which are the sum of the stack) are left unrounded. Is there any way to cut these data labels to precision X? The normal plotOptions.series.dataLabels.formatter don't seem to work here.

we are using highcharts and are trying to use stacked charts, but running into some issues. See the following fiddle:

http://jsfiddle/ggoforth/n5yba/

I'm able to display the number to a given precision, however the data labels (which are the sum of the stack) are left unrounded. Is there any way to cut these data labels to precision X? The normal plotOptions.series.dataLabels.formatter don't seem to work here.

Share Improve this question asked Aug 30, 2012 at 21:09 Greg Greg 6,6339 gold badges47 silver badges63 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2
stackLabels: {
    enabled: true,
    style: {
        fontWeight: 'bold',
        color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
    },
    formatter: function() {
        return  Highcharts.numberFormat(this.total, 2, ',');
    }
}

Demo

Looks like I needed yAxis.stackLabels.formatter which I didn't find until just now ;)

发布评论

评论列表(0)

  1. 暂无评论