Bold X-Axis Label on Point Hover in Highcharts Column Chart

后端 未结 2 1583
我在风中等你
我在风中等你 2021-01-16 21:18

I\'m using a Highcharts column chart (http://www.highcharts.com/demo/column-basic) with over 50 rows of data and 3 different series. Because of this amount and the chart wid

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-16 21:48

    Here's a quick sample I just created. I'm tired and it could be improved. It links the axis label to the mouseover by point index:

              series: {
                    point: {
                        events: {
                            mouseOver: function() {
                               $(this.series.chart.xAxis[0].labelGroup.element.childNodes[this.x]).css('fill', 'black');
                            },
                            mouseOut: function() {                       
                                 $(this.series.chart.xAxis[0].labelGroup.element.childNodes[this.x]).css('fill', '#999999');
                            }
                        }
                    }
                }
    

    Fiddle here.

提交回复
热议问题