JMH
JMH

Reputation: 461

Line to the Y axis on hover

charts/stack-overflow,

I would like to make it easy for end users to compare points in an area/line chart. As such, when they hover on a point, I would like to draw a horizontal line from that point all the way to the left and to right. Unlike a plotLine (which i understand to be static), this would be appear/disappear/change based on which point you are hovering on.

You can see something similar on the stockcharts where a vertical line goes down to the X-axis.

Any ideas?

Upvotes: 0

Views: 645

Answers (1)

ppotaczek
ppotaczek

Reputation: 39099

Use yAxis.crosshair:

    yAxis: {
        crosshair: {
            ...
        }
    }

Live demo: http://jsfiddle.net/BlackLabel/6m4e8x0y/5003/

API Reference: https://api.highcharts.com/highcharts/yAxis.crosshair

Upvotes: 1

Related Questions