Highstock - Set extremes beyond the data range

早过忘川 提交于 2019-12-11 19:58:29

问题


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. 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. I made a fiddle showing this (http://jsfiddle.net/tW9Te/).

Is it possible to do what I'm saying?


回答1:


It's caused by ordinal axis. Set xAxis.ordinal = false and will work the way you want to, see: http://jsfiddle.net/tW9Te/1/



来源:https://stackoverflow.com/questions/22711081/highstock-set-extremes-beyond-the-data-range

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