highcharts不尊重我的x轴'日期间隔 [英] highcharts is not respecting my x-axis' date interval

查看:128
本文介绍了highcharts不尊重我的x轴'日期间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个星期每15分钟收集一系列数据。不幸的是,中间还有一周的数据丢失。这只是我业务的一个事实。当我使用Highcharts绘制这些数据时,它会压缩x轴(时间),使图表偏斜。例如,x轴每隔2小时会有一次重要的滴答,直到失踪的一周。然后它会跳到的主要对象。



无论数据如何,我都需要x轴保持一致。如果这在图表中造成很大的差距,就这样吧。



我已经浏览了文档,但什么都没发现。如果任何人都可以指引我访问相关的网页,那会很棒。谢谢!

解决方案

请参阅: https您需要设置 .highcharts.com / highstock#xAxis.ordinalrel =nofollow noreferrer> xAxis.ordinal 属性为 false ,默认情况下这是 true 真值值表示点应该以固定的时间间隔放置在wrt 空间(像素) False 改变点以固定的时间间隔wrt time

  xAxis:{
序数:false
}

线性x轴| Highstock @ jsFiddle



文件:
http://api.highcharts.com/highstock#xAxis.ordinal


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!

解决方案

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

这篇关于highcharts不尊重我的x轴'日期间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆