Charts 从xAxis.plotline live Highstock设置值

Charts 从xAxis.plotline live Highstock设置值,charts,highcharts,highstock,Charts,Highcharts,Highstock,我使用Highstock,并通过点击事件从xAxis.plotLine设置值。我如何才能直接显示它? 我使用xAxis.plotLines.value=this.x设置单击事件的值 series : [ { xField : 'deltaTime', yField : 'variableOne' },{ xField : 'deltaTime', yField : 'variableTwo', }], chartConfig : {

我使用Highstock,并通过点击事件从xAxis.plotLine设置值。我如何才能直接显示它? 我使用xAxis.plotLines.value=this.x设置单击事件的值

  series : [
      {
    xField : 'deltaTime',
    yField : 'variableOne'
  },{
    xField : 'deltaTime',
    yField : 'variableTwo',
  }],
  chartConfig : {          
        xAxis: {
        plotLines: [{
            width: 2,
            color: 'black'
        }]
    },
    rangeSelector : {
      selected : 1
    },
    plotOptions: {
            series: {
                cursor: 'pointer',
                point: {
                    events: {
                        click: function() {                           
                        var hcConfig = Chart.ux.HistoryChart.getConfig('single_line');
                        hcConfig.chartConfig.xAxis.plotLines.value = this.x;
                        }
                        }
                    }
                },
                marker: {
                    lineWidth: 1
                }
            }
        },
  }
}

要在创建图表后添加打印线,必须调用图表的xAxis对象的方法。您可以通过传递到单击处理程序中的
事件
参数访问它:

point: {
    events: {
        click: function(event) {
            event.point.series.xAxis.addPlotLine({ ... });
        }
    }
}

我已经回答了一个类似的问题@。

@dascoco很高兴能为您提供帮助,并欢迎您加入SO。如果回答了您的问题,请单击左侧的绿色箭头确认答案。