echarts饼图

欧阳小白 1年前 ⋅ 682 阅读
option = {
    tooltip: {
        trigger: 'item',
        formatter: '{b}: {c} ({d}%)',
    },
    graphic:{
        type:'text',
        left:'center',
        top:'center',
        z:2,
        zlevel:100,
        style:{
            text:'设备总数\n\n123456',
            x:200,
            y:200,
            textAlign:'center',
            fill:'white',
            width:600,
            height:60,
            fontSize:40,
        }
    },
    
    series: [
        {
            name: '访问来源',
            type: 'pie',
            radius: ['50%', '70%'],
            label:{
                normal:{
                    formatter:function(parmas){
                return parmas.name+":"+parmas.value+'\n'+parmas.percent+"%"
                
            },color:'white'
                }
            },
            data: [
                {value: 6728, name: '艾默生'},
                {value: 3364, name: '华为'},
                 {value: 1680, name: '中兴'},
                  {value: 1684, name: '洛基亚'}
            ]
        }
    ],
    color : [ '#597EF7', '#4ADFF6','#F99A42','#ED5063'],
};


全部评论: 0

    我有话说:

    咨询问题

    点击这里给我发消息

    淘宝咨询

    博主承接代做业务

    真·送云服务器

    咨询博主