同时移动两个相关高股价图表的手柄

Move handle of two related highstock charts at same time

本文关键字:高股价 两个 移动      更新时间:2023-09-26
嗨,我

有一个要求,我必须同时移动两个高股票图表的手柄。因此,如果移动其中任何一个的句柄,则第二个图表的句柄会相应地重新定位。

JS小提琴

在这里设置小提琴

相关代码类似于

//callback function to set event              
   function(chart){
     Highcharts.addEvent(chart.xAxis[0], 'setExtremes', function (e) {
    var allRelatedChartsDiv = $("[data-identifier = '"+identifier+"']").not(chart); 
     $.each(allRelatedChartsDiv ,function(index,graphContainer){
        var chartObj = $(graphContainer).highcharts();  
        chartObj.xAxis[0].setExtremes(parseFloat(e.min),parseFloat(e.max));
  });
    });             
    });

建议?

您可以开发/改编此示例: http://jsfiddle.net/Gv7Tg/33/允许使用setExtremes()同步图表