问题
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