react-jsx-highchart:在基于组件的Highchart中捕获自定义平移事件

时间:2018-11-05 03:59:34

标签: javascript reactjs highcharts react-highcharts

react-jsx-highchart:我一直在使用react-jsx-highcharts模块,将Highcharts集成到我的React App中。我试图在折线图中捕获Highchart平移自定义事件。这样一来,我应该能够捕捉到从左到右还是从右到左发生了两指平移,并因此可以传递参数以将动态数据加载到Highchart中。

当前我的组件是这样的:

render() {

    return (
      <div className="graphContainer">  
        <HighchartsStockChart plotOptions= { plotOptions } callback={this.getChart}>
          <Chart zoomType="x" panning = "true" pankey = "shift"   onRender={this.onRender} onSelection= { this.onSelection }/>
          <Tooltip />
          <XAxis labels = { xLabels } gridLineWidth = { gridLineWidth } plotLines = { plotLines }
               min = {xAxisRange.min} max = {xAxisRange.max} tickPositions = {xAxisRange.tickPositions}   >
            <XAxis.Title></XAxis.Title>
          </XAxis>
          <YAxis>
            <SplineSeries id="profit" name="Profit" color = "#0E5B78" data={data} gridLineWidth = { gridLineWidth } />        
          </YAxis>
        </HighchartsStockChart>
      </div>
    );
  }

我试图将此解决方案复制到react-jsx-highchart中,但是由于它不是react-jsx-highchart格式,因此无法使其工作 Catch panning event in Highcharts

有人知道基于xAxis的平移是否可以传递预先计算的时间范围吗?

0 个答案:

没有答案