Echarts实现环状半圆形饼图

实现效果

源于截图

实现代码

    option = {
        backgroundColor: '#fff',
        title: {
            text: "设备告警",
            textStyle: {
                color: '#000',
                fontSize: 32,
                fontWeight: 'bold'
           },
    left: 'center',
    top:100,
    bottom: '69%',
    itemGap: 60,
},
tooltip: {
    show: false,
},
color: ['#01dadc', '#23cea7', '#5096e0'],
legend: {
    orient: 'vertical',
    x: 690,
    y:120,
    data:['危急','严重','一般'],
    
},
series: [{
        name: '一般',
        type: 'pie',
        //起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
        startAngle: 0,
        hoverAnimation: false,
        tooltip: {
        },
        radius: ["30%", "47%"],
        center: ['50%', '80%'],
        label: {
            normal: {
                show: false,
                position: 'center',
                color: '#fff',
                formatter: function(params) {
                    return params.value
                },
            },
        },
        labelLine: {
            normal: {
                show: false
            }
        },
        data: [{
                value: 300,
                itemStyle: {
                    normal: {
                        color: "rgba(80,150,224,0)"
                    }
                }
            },
            {
                value: 270,
                itemStyle: {
                    normal: {
                        color: "rgba(80,150,224,1)"
                    }
                }

            },
            {
                value: 30,
                itemStyle: {
                    normal: {
                        color: "rgba(80,150,224,0.1)"
                    }
                }
            },

        ]
    },


    {
        name: '严重',
        type: 'pie',
        startAngle: 0,
        radius: ['50%', '67%'],
        center: ['50%', '80%'],
        legendHoverLink: false,
        hoverAnimation: false,
        avoidLabelOverlap: false,
        label: {
            normal: {
                show: false,
                position: 'center'
            },
            emphasis: {
                show: true,
                textStyle: {
                    fontSize: '30',
                    fontWeight: 'bold'
                }
            }
        },
        labelLine: {
            normal: {
                show: false
            }
        },
        data: [{
                value: 300,
                itemStyle: {
                    normal: {
                        color: "rgba(35,206,167,0)"
                    }
                }
            },
            {
                value: 210,
                itemStyle: {
                    normal: {
                        color: "rgba(35,206,167,1)"
                    }
                }

            },
            {
                value: 90,
                itemStyle: {
                    normal: {
                        color: "rgba(35,206,167,0.1)"
                    }
                }
            },

        ]
    },

    {
        name: '危急',
        type: 'pie',
        startAngle: 0,
        hoverAnimation: false,
        radius: ["70%", "87%"],
        center: ['50%', '80%'],
        label: {
            normal: {
                show: false,
                position: 'center'
            },
            emphasis: {
                show: true,
                textStyle: {
                    fontSize: '10',
                    fontWeight: 'bold'
                }
            }
        },
        labelLine: {
            normal: {
                show: false
            }
        },
        data: [{
                value: 300,
                itemStyle: {
                    normal: {
                        color: "rgba(1,218,220,0)"
                    }
                }
            },
            {
                value: 240,
                itemStyle: {
                    normal: {
                        color: "rgba(1,218,220,1)"
                    }
                }

            },
            {
                value: 60,
                        itemStyle: {
                            normal: {
                                color: "rgba(1,218,220,0.1)"
                            }
                        }
                    },
                ]
            }
        ]
    };

这里卿洋
愿喜❤️

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 这两天参加培训,见到了久未谋面的大学挚友,昨天下午和他一起在苏州河边走走,今天下午,我们一起去和另一位多年未见的大...
    谁的梦想在路上阅读 1,638评论 0 0
  • 当我在笔记本上写下今日小目标:18个时,在后面又追加了一句话:我还能被18打趴下两次???因为和昨天目标一样嘛,所...
    有点可爱的小马哥阅读 1,085评论 1 2
  • 因为是抱着《解忧杂货店》的同类作品去看的,所以看完之后有点失落啊。与《解忧》一样是描写小人物的坚持和温暖,但是,更...
    叶开开阅读 1,631评论 0 1
  • 今天学到什么? 1.git的配置 1.1·ssh·的配置 1.2.添加公钥 找到id-rsa.pub文本文档,将其...
    yt1997阅读 1,235评论 0 0
  • 毛姆从小读了很多书,他也确实喜欢读书。他所读的书确实让他很有见识,当他在二十多岁的年纪里,本该是拼命工作赚钱的时候...
    小小帅帅669阅读 1,280评论 0 0