本文介绍了我们可以在海图中制作嵌套的甜甜圈图吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用highchart库.我们可以在hightcharts中制作嵌套的dount图表吗?我能够制作甜甜圈图.我想在甜甜圈图内嵌套相同的内容.换句话说,我制作了甜甜圈图,可以在甜甜圈图内制作相同的东西

I am using highchart library .can we make nested dount chart in hightcharts ? I am able to make donut chart .I want to make nested the same thing inside the donut chart .In other words I make donut chart can I make same thing inside the donut chart

这是我的代码

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

我正在从中寻求帮助 http://www.highcharts.com/demo

I am taking help from thishttp://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
                    }
                }
            ]
        }]
    });
});

推荐答案

您必须更改系列中设置的data和饼图的size

You have to change data set in series and size of pie

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小提琴

这篇关于我们可以在海图中制作嵌套的甜甜圈图吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 20:37