简体   繁体   English

高库存-设置超出数据范围的极限

[英]Highstock - Set extremes beyond the data range

I have a highstock chart with data in the range [t1 , t2] in the x axis, and I want to set the axis extremes to [t1, t3], being t3 higher than t2, resulting this in a portion of the chart with no data. 我有一个高库存图表,其数据在x轴上的范围为[t1,t2],并且我想将轴极限值设置为[t1,t3],即t3高于t2,这导致图表的一部分与没有数据。 The chart has no navigator nor scrollbar nor range selector. 图表没有导航器,滚动条或范围选择器。

When I try to do this ... 当我尝试这样做时...

chart.xAxis[0].setExtremes(extremes.min, extremes.max + ((30 * 60 * 1000)));

... it seems like highstock is replacing the max I provide with the max of the data, but if I log the axis extremes after calling setExtremes, they are the ones I've provided, so it seems like there is an inconsistency between the chart internal options and what is actually being drawn. ...似乎highstock用数据的最大值代替了我提供的最大值,但是如果我在调用setExtremes之后记录了轴的极限值,它们就是我提供的值,所以似乎之间存在不一致图表内部选项以及实际绘制的内容。 I made a fiddle showing this ( http://jsfiddle.net/tW9Te/ ). 我做了一个小提琴,显示了这个内容( http://jsfiddle.net/tW9Te/ )。

Is it possible to do what I'm saying? 可以按照我说的做吗?

It's caused by ordinal axis. 这是由序数轴引起的。 Set xAxis.ordinal = false and will work the way you want to, see: http://jsfiddle.net/tW9Te/1/ 设置xAxis.ordinal = false并以您想要的方式工作,请参见: http : //jsfiddle.net/tW9Te/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM