[英]High Charts Column Chart - Y axis Label Formatting
我正在使用高圖表柱形圖。 這是我的圖表選項(y軸部分)。
yAxis: {
allowDecimals: false,
min: 0,
max: 100,
tickInterval: 25,
title: {
text: ''
}
// labels: {
// formatter: function () {
//
// }
// }
},
當前,它顯示的y軸標簽為0到100。但是,我想僅將'%'符號附加到'0'並保留其余標簽。 我嘗試使用標簽格式化程序,無法確定要使用的值。 有人可以建議我任何想法嗎?
謝謝
你可以試試:
labels: {
formatter: function() {
return this.value === 0 ? '0%' : this.value;
}
}
想通了。
labels: {
formatter: function () {
if (this.value == 0)
return this.value + "%";
else
return this.value;
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.