Erinnjoy
Posts: 14
Joined: Tue Sep 27, 2016 8:31 pm

Hover color change

Hi!

I'm trying to change the color of the series when I hover over it. How do I do that? Thanks!
stpoa

Re: Hover color change

Hi,

You can use marker.states.hover property, which lets you change properties of every point individually.

Example code:

Code: Select all

var options = {
    chart: {
      type: 'line'
    },
    xAxis: {
      categories: ['Jan', 'Feb']
    },

    series: [{
      data: [{
        y: 29.9,
        marker: {
          states: {
            hover: {
              fillColor: 'red'
            }
          },
        }
      }, {
        y: 71.5,
        marker: {
          states: {
            hover: {
              fillColor: 'green'
            }
          },
        }
      }]
    }]
  }

var chart = Highcharts.chart('container', options);
Live example:
https://jsfiddle.net/a6r8phb5/

Api reference:
http://api.highcharts.com/highcharts/pl ... ates.hover

Regards.

Return to “Highcharts Cloud”