如何在 Highcharts 的 xAxis 中显示 24 小时
how to display 24 hours in xAxis on Highcharts
我有一个仪表板需要显示图表中发表的文章总数。
我的 xAxis 需要显示 12:00am - 12:00 pm - 12:00am
当用户将鼠标悬停在图表上时,工具提示应显示每分钟发布的文章数。
悬停时的示例输出
12:00am - 55 篇文章
12:01am - 60 篇文章
12:02am - 45 篇文章
等等...
我是 Highcharts 的新手,系列选项仍然让我感到困惑。
Please click here to see the chart image I need
这是我的
xAxis: {
type: 'datetime' //ensures that xAxis is treated as datetime values
},
series: [{
// number of articles published per minute
data: [55,23,45,60,78,56],
pointStart: Date.UTC(2021, 0, 1, 12, 0)
}]
}
希望有人能帮帮我谢谢
您需要添加 tickInterval
API documentation
serie: {
pointInterval: 12 * 3600 * 1000, // 12 hours interval
...
}
我有一个仪表板需要显示图表中发表的文章总数。
我的 xAxis 需要显示 12:00am - 12:00 pm - 12:00am
当用户将鼠标悬停在图表上时,工具提示应显示每分钟发布的文章数。
悬停时的示例输出
12:00am - 55 篇文章
12:01am - 60 篇文章
12:02am - 45 篇文章
等等...
我是 Highcharts 的新手,系列选项仍然让我感到困惑。
Please click here to see the chart image I need
这是我的
xAxis: {
type: 'datetime' //ensures that xAxis is treated as datetime values
},
series: [{
// number of articles published per minute
data: [55,23,45,60,78,56],
pointStart: Date.UTC(2021, 0, 1, 12, 0)
}]
}
希望有人能帮帮我谢谢
您需要添加 tickInterval
API documentation
serie: {
pointInterval: 12 * 3600 * 1000, // 12 hours interval
...
}