【问题标题】:can we make nested donut charts in highcharts?我们可以在 highcharts 中制作嵌套的甜甜圈图吗?
【发布时间】:2017-01-11 06:50:35
【问题描述】:

我正在使用 highchart 库。我们可以在 hightcharts 中制作嵌套的圆点图吗?我可以制作圆环图。我想在圆环图中嵌套相同的东西。 换句话说,我做甜甜圈图我可以在甜甜圈图里面做同样的事情吗

这是我的代码

http://jsfiddle.net/oupmgvjy/2/

我正在从中获得帮助 http://www.highcharts.com/demo

$(function () {
    Highcharts.chart('container', {
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: 0,
            plotShadow: false
        },
        title: {
            text: 'Browser<br>shares<br>2015',
            align: 'center',
            verticalAlign: 'middle',
            y: 40
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                dataLabels: {
                    enabled: true,
                    distance: -50,
                    style: {
                        fontWeight: 'bold',
                        color: 'white'
                    }
                },
                startAngle: 0,
                endAngle: 270,
                center: ['50%', '75%']
            }
        },
        series: [{
            type: 'pie',
            name: 'Election',
            innerSize: '85%',
            data: [
                ['a',   55],
                ['b',       65],
                 ['c',   65],
                   ['d',   132],

                {
                    name: 'Proprietary or Undetectable',
                    y: 0.2,
                    dataLabels: {
                        enabled: false
                    }
                }
            ]
        }]
    });
});

【问题讨论】:

    标签: javascript jquery highcharts dotnethighcharts


    【解决方案1】:

    你必须改变data系列和馅饼的size

    series: [{
                type: 'pie',
                name: 'Election',
                size: '100%',
                innerSize: '40%',
                data: [{name: "A", y: 20},
                {name: "B", y: 10},
                {name: "C", y: 15}
                ]
            }, {
                type: 'pie',
                name: 'Proprietary or Undetectable',
                innerSize: '70%',
                data: [{name: "A", y: 10},
                {name: "B", y: 15},
                {name: "C", y: 20}
    
    
                ]
            }]
    

    JS Fiddle

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-25
    • 1970-01-01
    相关资源
    最近更新 更多