简体   繁体   English

Highcharts 中的移动导航器

[英]Moving navigator in Highcharts

I would like to fetch data for example from this website: https://www.highcharts.com/stock/demo/lazy-loading我想从这个网站获取数据,例如: https : //www.highcharts.com/stock/demo/lazy-loading

To get the data with high resolution, I have to set the min max to small value and then I have to go over the complete diagram.为了获得高分辨率的数据,我必须将 min max 设置为较小的值,然后我必须查看完整的图表。

It is possible to get data from the website with "Highcharts.charts[0].series[0]"可以使用“Highcharts.charts[0].series[0]”从网站获取数据

But I didn't find a possibility to programable changing the navigators, to get other data ranges.但是我没有找到可编程更改导航器以获取其他数据范围的可能性。

Is it possible to move the navigator to a specific position?是否可以将导航器移动到特定位置?

You can use Axis.setExtremes function for this.您可以为此使用Axis.setExtremes函数。

Live demo: http://jsfiddle.net/kkulig/am3cgo5w/现场演示: http : //jsfiddle.net/kkulig/am3cgo5w/

API reference: https://api.highcharts.com/class-reference/Highcharts.Axis#setExtremes API 参考: https : //api.highcharts.com/class-reference/Highcharts.Axis#setExtremes

Thank you for your answear.谢谢你的回答。 Here is my code if somebody needs:如果有人需要,这是我的代码:

I saw, that the redraw event will be called 5 times till the diagram is finishd redrawn我看到,重绘事件将被调用 5 次,直到图表完成重绘

counter = 1
// Get chart
chart = $('#highcharts-graph').highcharts()
// add event
Highcharts.addEvent(chart, 'redraw', function (e) {
console.log(counter); 
counter = counter+1; 
if(counter>5){
    console.log('finish loaded')
    function2()
}
})
var newSelectedMin = 0
var newSelectedMax = 10
chart.xAxis[0].setExtremes(newSelectedMin, newSelectedMax);

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

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