Line to the Y axis on hover

痴心易碎 提交于 2021-01-29 20:39:36

问题


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?


回答1:


Use yAxis.crosshair:

    yAxis: {
        crosshair: {
            ...
        }
    }

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

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



来源:https://stackoverflow.com/questions/61702783/line-to-the-y-axis-on-hover

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!