• 周四. 2月 29th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

echarts 多层环形图配置

admin

11月 28, 2021

echarts 多层环形图配置

 var BorderWidth = '6';
    //反方向剩下部分的样式
    var placeHolderStyle = {
        normal: {
            label: {
                show: false,
                position: "center"
            },
            labelLine: {
                show: false
            },
            color: "#3A4154",
            borderColor: "#3A4154",
            borderWidth: 6
        },
        emphasis: {
            color: "#dedede",
            borderColor: "#dedede",
            borderWidth: 0
        }
    }
option = {
     tooltip: {
          trigger: 'item',
          formatter:function (params){
              return`${params.name}${params.value} <br/> 占比%`
                        }
        },
        color: ['#7B79FF', '#FFB0E2', '#59CFFF'],
  
        series: [{
            name: '入厕人数',
            type: 'pie',
            clockWise: true, //顺时加载
            hoverAnimation: false, //鼠标移入变大
            radius: ['95%', '96%'],
            itemStyle: {
                normal: {
                    label: {
                        show: false,
                        position: 'outside'
                    },
                    labelLine: {
                        show: false,
                        length: 100,
                        smooth: 0.5
                    },
                    borderWidth: BorderWidth,
                    shadowBlur: 40,
                    borderColor: "#7B79FF",
                    shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影
                }
            },
            data: [{
                value: 7,
                name: '入厕人数'
            },
             {
                value: 3,
                name: '',
                itemStyle: placeHolderStyle
            }
            ]
        }, {
            name: '就餐人数',
            type: 'pie',
            clockWise: true,
            hoverAnimation: false,
            radius: ['85%', '86%'],
            itemStyle: {
                normal: {
                    label: {
                        show: false
                    },
                    labelLine: {
                        show: false,
                        length: 100,
                        smooth: 0.5
                    },
                    borderWidth: BorderWidth,
                    shadowBlur: 40,
                    borderColor: "#FFB0E2",
                    shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影
                }
            },
            data: [{
                value: 6,
                name: '就餐人数'
            }, 
            {
                value: 4,
                name: '',
                itemStyle: placeHolderStyle
            }
            ]
        },  {
            name: '购物人数',
            type: 'pie',
            clockWise: true,
            hoverAnimation: false,
            radius: ['75%', '76%'],
            itemStyle: {
                normal: {
                    label: {
                        show: false
                    },
                    labelLine: {
                        show: false,
                        length: 100,
                        smooth: 0.5
                    },
                    borderWidth: BorderWidth,
                    shadowBlur: 40,
                    borderColor: "#59CFFF",
                    shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影
                }
            },
            data: [{
                value: 5,
                name: '购物人数'
            }, 
            {
                value: 5,
                name: '',
                itemStyle: placeHolderStyle
            }
            ]
        }]


};

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注