英文:
How change local names for weeks in highcharts gantt
问题
我在本地化中添加了本地名称,并更改了xAxis.dateTimeLabelFormats.weeks
。但是当我导航到短时间段时,它显示的是Week
(而不是预期的Неделя
)。
在较长的时间段上,它显示了正确的Week
名称(如Неделя
)。
高图版本为9.3.3。
我该如何修复这个错误?
谢谢帮助!
英文:
I added local names in locale and change xAxis.dateTimeLabelFormats.weeks
. But when I navigate to short time period, it shows Week
(not Неделя
as expected)
On longer time period it shows right Week
name (as Неделя
)
xAxis = {
...
dateTimeLabelFormats: {
hour: { list: ['%H:%M', '%H'] },
day: { list: ['%A, %e. %B', '%a, %e. %b', '%E'] },
week: { list: ['Неделя %W', 'Н%W', 'Н%W'] },
month: { list: ['%B', '%b', '%o'] },
},
}
highcharts version 9.3.3
How can I fix this bug?
Thanks for help!
答案1
得分: 1
这是由于仅为一个x轴设置了dateTimeLabelFormats而导致的正确行为。根据您的要求,您需要为两个轴设置这些选项:
xAxis:[{
dateTimeLabelFormats:{
hour:{
list:['%H:%M','%H']
},
day:{
list:['%A,%e。%B','%a,%e。%b','%E']
},
week:{
list:['Неделя%W','W%W']
},
month:{
list:['%B','%b','%o']
}
},
},{
dateTimeLabelFormats:{
hour:{
list:['%H:%M','%H']
},
day:{
list:['%A,%e。%B','%a,%e。%b','%E']
},
week:{
list:['Неделя%W','W%W']
},
month:{
list:['%B','%b','%o']
}
},
}]
演示:
https://jsfiddle.net/BlackLabel/fwpusL5n/
英文:
This is the correct behavior that is caused by setting dateTimeLabelFormats only for one xAxis. In case of your requirements, you need to set theese options for both axis:
xAxis:[{
dateTimeLabelFormats: {
hour: {
list: ['%H:%M', '%H']
},
day: {
list: ['%A, %e. %B', '%a, %e. %b', '%E']
},
week: {
list: ['Неделя %W', 'W%W']
},
month: {
list: ['%B', '%b', '%o']
}
},
},{
dateTimeLabelFormats: {
hour: {
list: ['%H:%M', '%H']
},
day: {
list: ['%A, %e. %B', '%a, %e. %b', '%E']
},
week: {
list: ['Неделя %W', 'W%W']
},
month: {
list: ['%B', '%b', '%o']
}
},
}],
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论