Highcharts 如何在下图所示的highchart中显示垂直线?

Highcharts 如何在下图所示的highchart中显示垂直线?,highcharts,Highcharts,如何显示垂直线与十字线相同,但不是全高。它不应该超出图中所示的绘图点 在mouseOver事件中使用Highcharts.svgrender.path方法,例如: series: [{ ..., point: { events: { mouseOver: function() { var chart = this.series.chart,

如何显示垂直线与十字线相同,但不是全高。它不应该超出图中所示的绘图点


mouseOver
事件中使用
Highcharts.svgrender.path
方法,例如:

    series: [{
        ...,
        point: {
            events: {
                mouseOver: function() {
                    var chart = this.series.chart,
                        x = this.plotX + chart.plotLeft,
                        y1 = this.plotY + chart.plotTop,
                        y2 = chart.plotTop + chart.plotHeight;

                    this.customCrosshair = chart.renderer.path(
                            ['M', x, y1, 'L', x, y2]
                        )
                        .attr({
                            'stroke-width': 2,
                            dashstyle: 'dot',
                            stroke: 'gray'
                        })
                        .add();
                },
                mouseOut: function() {
                    this.customCrosshair.destroy();
                }
            }
        }
    }]

现场演示:

API参考: