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

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

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 ;)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744864426a4597893.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信