javascript - 保留 Highstock 图表中缺口的时间间隔比率

标签 javascript highcharts

在 Highstock 图表中,无论间隙的时间间隔如何,任何间隙都将始终具有相同的宽度(似乎是点之间最小距离的宽度),从而导致时间/x 轴变窄,而这并不会这不会发生在“导航”系列中。

Example of gap

是否有任何简单的方法可以使图表根据其持续时间保留间隙的间距,就像导航栏中已经发生的那样(从而保持 x 轴不缩小)?

最佳答案

标准 Highstock 图表默认使用序数 x 轴。

In an ordinal axis, the points are equally spaced in the chart regardless of the actual time or x distance between them. This means that missing data for nights or weekends will not take up space in the chart. Defaults to true.

您可以尝试通过将 xAxis.ordinal 设置为 false http://api.highcharts.com/highstock/xAxis.ordinal 来禁用此参数。

        xAxis: {
            ordinal: false
        },

关于javascript - 保留 Highstock 图表中缺口的时间间隔比率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39632659/

相关文章:

javascript - 单击 Highcharts 中的系列时绘制一条垂直线。

javascript - 将innerHTML从一个元素复制到另一个

javascript - JQuery/JavaScript : Is it possible do this (watch link below) with simple image on webpage?

javascript - 如何显示每个页面上显示了多少项目的信息,AngularJs 分页

highcharts - 如何更改 highcharts 柱状图中每个类别的颜色?

javascript - 如何在不重新绘制的情况下更新 Highcharts 中的条形图

javascript - 就在我认为我终于理解了 Javascript 作用域的时候

javascript - 使用外部多模式 JavaScript

javascript - 向下钻取不同的图表类型会在向上钻取时留下痕迹吗?

javascript - 如何使用 highstocks 在 Highcharts 中用我们自己的来自 API 的时间戳数据替换 x 轴