[英]how to remove "0%" at middle of graph?
我在 plotOptions 中嘗試了“堆疊”和“樣式”以刪除圖表中間的 0%。 請查看我的“codepen”示例以了解我的問題並幫助我。
plotOptions: {
bar: {
stackings: 'normal',
dataLabels: {
enabled: true,
format: '{y} %',
},
marker: {
enabled: false,
},
},
series: {
grouping: false,
},
},
使用formatter
function 並僅顯示值不同於 0 的數據標簽:
plotOptions: {
bar: {
...,
dataLabels: {
enabled: true,
formatter: function() {
if (this.y !== 0) {
return this.y + ' %';
}
}
}
}
}
現場演示: http://jsfiddle.net/BlackLabel/t98hzdbx/
API 參考: https://api.highcharts.com/highcharts/series.column.dataLabels.formatter
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.