简体   繁体   中英

Highcharts pie chart outer circle

Is it possible to add a circle around a pie chart in highcharts?

I know I can do it with an absolute positioned div just over the size of the chart, with a negative zIndex, but it doesn't look entirely right since the graph is drawn with SVG (notice the slight offset on the attached image where I've tried that approach

Thank you!

图片

You could use a shadow with a 0 offset.
http://jsfiddle.net/blaird/RgdJ3/

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'pie'
        },
        plotOptions: {  
            pie: {
                shadow: {
                    color: 'black', 
                    offsetX : 0,
                    offsetY: 0,
                    opacity: 1,
                    width: 3
                }
            }
        },

        series: [{
            data: [
                ['Firefox',   44.2],
                ['IE7',       26.6],
                ['IE6',       20],
                ['Chrome',    3.1],
                ['Other',    5.4]
            ]
        }]
    });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM