gpt4 book ai didi

javascript - 如何在 x 轴上显示月份和年份,并在 Highcharts 中显示为数字?

转载 作者:行者123 更新时间:2023-12-02 21:16:49 58 4
gpt4 key购买 nike

现在在我的 Highcharts 中,我有 x 轴显示日期。显示的日期格式如下

2019年11月30日10:00

我的 x 轴设置

          xAxis:{
type:'datetime',
title:
{
align:'high'
},
labels: {
padding: 50,
format: '{value:%e %b %Y %H:%M}',
style: {
fontSize: '10px'
}
}
},

如何才能显示日期

30 11 19 10:00

谢谢

最佳答案

您可以使用文档中显示的格式:https://api.highcharts.com/class-reference/Highcharts#.dateFormat :

      xAxis:{
type:'datetime',
title:
{
align:'high'
},
labels: {
padding: 50,
format: '{value:%d %m %y %H:%M}',
style: {
fontSize: '10px'
}
}
},

更一般地说,这些格式在许多编程语言中广泛使用,引用文献是 PHP's strftime implementation .

关于javascript - 如何在 x 轴上显示月份和年份,并在 Highcharts 中显示为数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60946617/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com