admin管理员组

文章数量:1410712

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

本文标签: javascripthighchartsprecision for stacked column chart data labelsStack Overflow