admin管理员组

文章数量:1291667

I am using a nested pie chart in my application - The configuration is -

{
  options: {
    grid: {
        left: '300px'
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data: ['Autobots','Deceptiocons']
    },
    series: [
        {
            name: 'Audit',
            type: 'pie',
            radius: [30%, '50%'],
            label: {
                normal: {
                    position: 'center',
                    color: '#fff'
                }
            },
            data: [{ value: 500, name: 'Autobots'},{ value: 500, name: 'Decepticons'}]
        }
    ]
  }
}

I am using grid , but still the chart is displayed in the center.

I am using a nested pie chart in my application - The configuration is -

{
  options: {
    grid: {
        left: '300px'
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data: ['Autobots','Deceptiocons']
    },
    series: [
        {
            name: 'Audit',
            type: 'pie',
            radius: [30%, '50%'],
            label: {
                normal: {
                    position: 'center',
                    color: '#fff'
                }
            },
            data: [{ value: 500, name: 'Autobots'},{ value: 500, name: 'Decepticons'}]
        }
    ]
  }
}

I am using grid , but still the chart is displayed in the center.

Share Improve this question edited Dec 7, 2021 at 20:55 GG. 21.9k14 gold badges91 silver badges132 bronze badges asked Mar 29, 2019 at 11:00 BopsiBopsi 2,4566 gold badges41 silver badges64 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Line chart, bar chart, and scatter chart (bubble chart) can be drawn in grid

For pie chart, please use Center position of Pie chart: https://echarts.apache/en/option.html#series-pie.center

center: ['20%', '50%']

本文标签: javascriptECharts align pie chart to the rightStack Overflow