Can I assign a different radius for each pie slice using Highcharts?

前端 未结 2 1074
情书的邮戳
情书的邮戳 2021-01-13 18:23

I am using Highcharts and it is working just amazing, i am stuck at a place where i want to plot a pie chart in which every pie slice (in a single pie chart) has a different

2条回答
  •  星月不相逢
    2021-01-13 18:34

    The variablepie series type, introduced in Highcharts 6.0.0, handles this with less code. In this series type you can specify a z-parameter for each data point to alter its z-size.

    For example (JSFiddle, documentation):

    Highcharts.chart('container', {
        chart: {
            type: 'variablepie'
        },
        title: {
            text: 'Variable pie'
        },
        series: [{
            minPointSize: 10,
            innerSize: '20%',
            zMin: 0,
            name: 'countries',
            data: [{
                name: 'Pune',
                y: 35,
                z: 25
            }, {
                name: 'Mumbai',
                y: 30,
                z: 20
            }, {
                name: 'Nagpur',
                y: 15,
                z: 15
            } , {
                name: 'Thane',
                y: 25,
                z: 10
            }]
        }]
    });
    

    This requires including:

    
    

提交回复
热议问题