jlbriggs
jlbriggs

Reputation: 17791

Highcharts, bar chart, change bar color on hover?

Using the states.hover property on a bar chart, there does not seem to be a direct way to change the color of the hovered bar.

Reference:

Is there a work around for this?

Seems very odd to be able to update the "brightness", but not just be able to directly specify a hover state fill color...

{{EDIT

Ok, so, the hover.color works if no color is explicitly set on the bar, but does not if the color is set at the point level (ie '{y:8, color:'#00ff00'}').

Example:

I have a chart where I need to set some colors explicitly on the point level, but still want to override the color on hover.

Any ideas?

Upvotes: 0

Views: 2494

Answers (2)

Abdul Wahab
Abdul Wahab

Reputation: 328

Simply Provide it in the configure obj

    series: [
        {
            //data
            states: {
                hover: {
                    brightness: 0.5,
                    color: '#4318FF'
                }
            },
        }
    ],

Upvotes: 0

giannisf
giannisf

Reputation: 2599

there is color property.

 states: {
          hover: {
                 brightness: 0.2,
                 color: '#ffccee'
                    }
}

Upvotes: 3

Related Questions