Display data on echart pie chart

option = {
    
    
  title: {
    
    
    text: '游戏比例',
    left: 'center'
  },
  tooltip: {
    
    
    trigger: 'item'
  },
  color: ['#fdab03','#f27647'],
  legend: {
    
    
    orient: 'horizontal',
    x: 'center',
    y: 'bottom',
  },
  series: [
    {
    
    
      type: 'pie',
      data: [
        {
    
     value: 500, name: '王者' },
        {
    
     value: 500, name: 'lol' }
      ],
      margin:5,
      itemStyle:{
    
    
            normal:{
    
    
                  label:{
    
    
                    show: true,
                    formatter: '{b} : {d}%',
                    position: 'inside',
                    color:'#fff'
                  },
                  labelLine :{
    
    show:false}
                }
        },
    }
  ]
};

insert image description here

Guess you like

Origin blog.csdn.net/sxmzhw/article/details/120728689