小编Man*_*ani的帖子

HighCharts饼图中的值总和

有没有办法在图例或饼图中的任何其他位置获得总值?这是带有图例的代码,但我想显示值的总和,而不是添加总百分比.

$(function () {
    var chart = new Highcharts.Chart({

        chart: {
            renderTo: 'container',
            type: 'pie',
            width: 500,
            borderWidth: 2
        },

        title: {
            text: 'demo'
        },

        credits: {
            enabled: false
        },

        legend: {

            layout: 'vertical',
            align: 'right',
            verticalAlign: 'top',
            y: 30,
            labelFormat: '{name} ({percentage:.1f}%)',
            navigation: {
                activeColor: '#3E576F',
                animation: true,
                arrowSize: 12,
                inactiveColor: '#CCC',
                style: {
                    fontWeight: 'bold',
                    color: '#333',
                    fontSize: '12px'    
                }
            }
        },
    tooltip: {
            formatter: function() {
                return Highcharts.numberFormat(this.percentage, 2) + '%<br />' + '<b>' + this.point.name + …
Run Code Online (Sandbox Code Playgroud)

javascript charts highcharts

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

charts ×1

highcharts ×1

javascript ×1