[英]Dynamically change datetime format of xAxis Tick Label in highchart
[英]How to change format of the upper xAxis Label?
我已經想出了如何使用以下代碼段(數周,代碼放置在 xAxis 中)更改下面的工作日標簽(T、W、T 等):
dateTimeLabelFormats: {
week: {
list: ['Kalenderwoche %W', 'KW%W']
}
},
您有 2 個 xAxis。 所以你應該提供dateTimeLabelFormats
數組。
索引較低的軸將放置在較低的位置。
所以,你的 xAxis 應該是
xAxis: [{
currentDateIndicator: true,
dateTimeLabelFormats: {
day: {
list: ['%A, %e. %B', '%a, %e. %b', '%E']
}
}
},
{
dateTimeLabelFormats: {
week: {
list: ['Kalenderwoche %W', 'KW%W']
},
month: {
list: ['Monat%W', 'KW%W']
}
}
}
],
根據this page ,方法是將x軸設置為對象數組,每個對象代表x軸的一個級別(日、周、月等)。 在這種情況下: https://jsfiddle.net/vm5t78j3/
xAxis: [{
currentDateIndicator: true,
}, {
labels: {
format: '{value:%W}'
},
}],
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.