![](/img/trans.png)
[英]How to change the color of non progreesed bar in Apexcharts RadialBar Charts?
[英]How to change bar color at a specific value with Apex Charts?
有沒有辦法更改 Apex 圖表上低於特定值的條形顏色? 例如,當重量超過 200 磅時,條形變為紅色。
這是我正在使用的代碼,但我不太確定我應該為價值、seriesIndex 和 w
colors: ['#02DFDE'],
fill: {
colors: [function({ value, seriesIndex, w }) {
if(value < 360) {
return '#FF0000'
} else {
return '#02DFDE'
}
}]
},
如果你想根據值設置顏色,那么這個 function 就足夠了
colors: [
function({ value, seriesIndex, w }) {
if (value < 5000) {
return '#FF0000'
} else {
return '#02DFDE'
}
}
]
完整示例 - https://codepen.io/apexcharts/pen/RwRNXzX?editors=0010
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.