简体   繁体   English

默认情况下设置highstock图表导航器最大范围

[英]Set highstock chart navigator max range by default

I have a set of pulled data which I don't know the start date and the end date. 我有一组提取的数据,我不知道开始日期和结束日期。 on page load, i want the highstock chart to set the navigator to range from the start date through the end date, like its zoomed out all the way, similar to clicking the "All" button in the rangeSelector. 在页面加载时,我希望highstock图表将导航器设置为从开始日期到结束日期的范围,就像其一直缩小一样,类似于单击rangeSelector中的“全部”按钮。 Unfortunately, the mockup requires that we remove the range selector and the date input fields so we're only left with the navigator. 不幸的是,样机要求我们删除范围选择器和日期输入字段,因此我们只剩下导航器。 How do I do that? 我怎么做?

The current range of the navigator seems to be on the most recent year only but I don't want that. 导航器的当前范围似乎仅是最近一年,但我不希望如此。 Looked through lots of forums but can't find any solution. 浏览了很多论坛,但找不到任何解决方案。 thanks for the help! 谢谢您的帮助!

You need to call setExtremes on xAxis, with defined min/max. 您需要使用定义的最小/最大值在xAxis上调用setExtremes These values can be extracted from our source data (first and last element). 这些值可以从我们的源数据(第一个和最后一个元素)中提取。

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

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