最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highcharts Change column color on hover - Stack Overflow

programmeradmin0浏览0评论

It seems like this should be simple, but I cannot figure it out and nothing in the API documentation seems to be working. I want to change the color of a single column when that column is hovered.

I have tried setting each point in the data to have a hover state with colorFill, but to no avail, i have also tried setting it in plotOptions in the column attribute

Here is a little something to help: /

Tried this: .data.marker.states.hover.fillColor
Tried this: .column.states.hover.marker.fillColor
Both did not work. Not sure what else to do.

I found this: Highcharts: changing color on hover ranking chart but it changes the whole series, not just the current point/column.

It seems like this should be simple, but I cannot figure it out and nothing in the API documentation seems to be working. I want to change the color of a single column when that column is hovered.

I have tried setting each point in the data to have a hover state with colorFill, but to no avail, i have also tried setting it in plotOptions in the column attribute

Here is a little something to help: http://jsfiddle.net/TheSharpieOne/DMcQ3/

Tried this: http://api.highcharts.com/highcharts#series.data.marker.states.hover.fillColor
Tried this: http://api.highcharts.com/highcharts#plotOptions.column.states.hover.marker.fillColor
Both did not work. Not sure what else to do.

I found this: Highcharts: changing color on hover ranking chart but it changes the whole series, not just the current point/column.

Share Improve this question edited May 23, 2017 at 12:34 CommunityBot 11 silver badge asked Oct 2, 2013 at 20:16 TheSharpieOneTheSharpieOne 25.7k9 gold badges70 silver badges80 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 17

You were almost there, but you want to set color and not fillColor (and not on the marker)-- I added this to the chart declaration:

plotOptions: {
    column: {
        states: {
            hover: {
                color: '#000000'                                                           
            }
        }
    }
}

And removed the states stuff from the column data, that seems to work in this fiddle.

And, yes, that's not very clear in the documentation ...

发布评论

评论列表(0)

  1. 暂无评论