Echarts實現(xiàn)環(huán)狀半圓形餅圖

實現(xiàn)效果

源于截圖

實現(xiàn)代碼

    option = {
        backgroundColor: '#fff',
        title: {
            text: "設(shè)備告警",
            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:['危急','嚴(yán)重','一般'],
    
},
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: '嚴(yán)重',
        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)"
                            }
                        }
                    },
                ]
            }
        ]
    };

這里卿洋
愿喜??

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 這兩天參加培訓(xùn),見到了久未謀面的大學(xué)摯友,昨天下午和他一起在蘇州河邊走走,今天下午,我們一起去和另一位多年未見的大...
    誰的夢想在路上閱讀 278評論 0 0
  • 當(dāng)我在筆記本上寫下今日小目標(biāo):18個時,在后面又追加了一句話:我還能被18打趴下兩次???因為和昨天目標(biāo)一樣嘛,所...
    有點可愛的小馬哥閱讀 177評論 1 2
  • 因為是抱著《解憂雜貨店》的同類作品去看的,所以看完之后有點失落啊。與《解憂》一樣是描寫小人物的堅持和溫暖,但是,更...
    葉開開閱讀 268評論 0 1
  • 今天學(xué)到什么? 1.git的配置 1.1·ssh·的配置 1.2.添加公鑰 找到id-rsa.pub文本文檔,將其...
    yt1997閱讀 223評論 0 0
  • 毛姆從小讀了很多書,他也確實喜歡讀書。他所讀的書確實讓他很有見識,當(dāng)他在二十多歲的年紀(jì)里,本該是拼命工作賺錢的時候...
    小小帥帥669閱讀 204評論 0 0

友情鏈接更多精彩內(nèi)容