0

我正在尝试制作圆形甜甜圈图-:以下是我正在尝试的代码。问题-:圆图的底部变平。

$(function () {
$('#container').highcharts({
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: 0,
        plotShadow: false
    },
    title: {
        text: 'Browser<br>shares',
        align: 'center',
        verticalAlign: 'middle',
        y: 50
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
        pie: {
            dataLabels: {
                enabled: true,
                distance: -50,
                style: {
                    fontWeight: 'bold',
                    color: 'white',
                    textShadow: '0px 1px 2px black'
                }
            },
            startAngle: 1,
            endAngle: 360,
            center: ['50%', '75%']
        }
    },
    series: [{
        type: 'pie',
        name: 'Browser share',
        innerSize: '40%',
        data: [
            ['Firefox',   45.0],
            ['IE',       26.8],
            ['Chrome', 12.8],
            ['Safari',    8.5],
            ['Opera',     6.2],
            ['Others',   0.7],
             ['Safari',    8.5],
            ['Opera',     6.2],
            ['Others',   0.7]
        ]
    }]


   });
});

我希望该图表显示为完整的圆圈,整个图表位于该图表的中心。虽然甜甜圈图可在http://www.highcharts.com/demo/pie-donut获得,但它就像一个完整的圆圈,中间没有空格。

4

1 回答 1

0

我认为问题在于您为饼图设置了错误的中心,请参阅:http: //jsfiddle.net/na86z/7/

应该:

center: ['50%', '50%']
于 2013-12-02T11:15:31.020 回答