Highcharts: how to change line color when hovering a scatterplot series

耗尽温柔 提交于 2019-11-29 05:22:18

This can be easily achieved with events.

All you need is to update the series color property when user hovers on a series

events: {
    mouseOver: function () {

        this.chart.series[this.index].update({
             color: 'red'
        });
    },
    mouseOut: function () {

        this.chart.series[this.index].update({
            color: "#b0b0b0"
        });                           
     }
 }

This will change the color of the series of which the point is hovered.

here is update to your fiddle

Hope This has helped you.

Thank you strikers

@HalvorStrand is sticky tracking disabled?? it is enabled by default. If you have multiple series and they run through same xAxis points, I advice to disable sticky tracking. – strikers Jan 4 at 5:23

i was struggling with this until i put this after plotoptions series: {stickyTracking: false}, problem solved

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