highcharts is not respecting my x-axis' date interval

我们两清 提交于 2019-12-12 15:01:31

问题


I have a series of data collected every 15 minutes for a few weeks. Unfortunately, there's a week of missing data in the middle. This is just a fact of my business. When I use Highcharts to chart this data, it compresses the x-axis (time), skewing the chart. For example, the x-axis has major ticks every 2 hours until the missing week. Then it jumps to major ticks of days.

Regardless of the data, I need the x-axis to remain consistent. If this causes a large gap in the diagram, so be it.

I have skimmed the documentation but found nothing. If anyone could direct me to the relevant page that would be great. Thanks!


回答1:


Refer: https://stackoverflow.com/a/13439281/1566575

You will need to set the xAxis.ordinal property to false, this is true by default. True value indicates the points should be placed at fixed intervals w.r.t space (pixels), and False changes points to be placed at fixed intervals w.r.t. time

xAxis: {       
    ordinal: false
}

Linear x-axis | Highstock @ jsFiddle

Docs: http://api.highcharts.com/highstock#xAxis.ordinal



来源:https://stackoverflow.com/questions/25557734/highcharts-is-not-respecting-my-x-axis-date-interval

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!