ECharts 儀表盤改變顏色
阿新 • • 發佈:2019-01-07
做專案用到儀表盤,但是官方例項的儀表盤如下:
但是想讓 紅色在0-20 ,80-100是綠色
option = {
tooltip : {
formatter: "{a} <br/>{b} : {c}%"
},
toolbox: {
feature: {
restore: {},
saveAsImage: {}
}
},
series: [
{
name: '業務指標',
type: 'gauge' ,
detail: {formatter:'{value}%'},
axisLine: { // 座標軸線
lineStyle: { // 屬性lineStyle控制線條樣式
color: [[0.2, '#c23531'], [0.8, '#63869e'], [1, '#91c7ae']]
}
},
data: [{value: 50 , name: '完成率'}]
}
]
};
效果圖: