Highstock:指定x轴日期时间段(Highstock: specify x

系统教程 行业动态 更新时间:2024-06-14 17:04:02
Highstock:指定x轴日期时间段(Highstock: specify x-axis datetime period)

如何指定Highstock xAxis日期时间段,如下图所示(在图像编辑器中制作)?

我需要在指定的时间段内显示不同的系列(例如,一周)。 并且可能存在这样的情况:数据周期的大小小于图表周期的大小(存在以数据丢失开始的系列)。 但是Highstock图表是缩放的,所以系列从图表开始开始,图表的大小例如是一周的一半,但我需要保持周期相同。

先谢谢你!

How to specify Highstock xAxis datetime period as it is shown on the picture below (made in a image editor)?

I need to show different line series for specified time period (for example, one week). And there may be cases when size of data period is less than size of the chart period (there are series that starts with a data loss). But Highstock chart is scaled so series starts from chart beginning and the chart has the size of, for example, half of a week, but I need to keep the period the same.

Thank you in advance!

最满意答案

它是由ordinal选项引起的,请参阅docs 。 禁用此选项并设置xAxis.min和xAxis.max 。 演示: http : //jsfiddle.net/L3jqL0hw/

代码示例:

xAxis: { ordinal: false, min: Date.UTC(2007, 0, 1), max: Date.UTC(2019, 0, 1) },

It is caused by ordinal option, see docs. Disable this and set xAxis.min and xAxis.max. Demo for you: http://jsfiddle.net/L3jqL0hw/

Code sample:

xAxis: { ordinal: false, min: Date.UTC(2007, 0, 1), max: Date.UTC(2019, 0, 1) },

更多推荐

本文发布于:2023-04-24 20:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/7b938c18f16204f5d852aabf83d5ce6e.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时间段   日期   Highstock

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!