Highcharts悬停时更改列颜色 [英] Highcharts Change column color on hover

查看:139
本文介绍了Highcharts悬停时更改列颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来这应该很简单,但我无法弄清楚,API文档中的任何内容似乎都不起作用。我希望在该列悬停时更改单个列的颜色。



我试图设置数据中的每个点以使悬停状态为 colorFill ,但无济于事,我也尝试在列中设置它< plotOptions attribute



这里有一些帮助: http://jsfiddle.net/TheSharpieOne/DMcQ3/



试过这个: http://api.highcharts.com/highcharts#series.data.marker.states.hover.fillColor < br>
试过这个: http:// api .highcharts.com / highcharts#plotOptions.column.states.hover.marker.fillColor

两者都不起作用。不知道该怎么办。



我发现这个: Highcharts:改变悬停排名图表上的颜色,但它改变了整个系列,而不仅仅是当前的点/列。 >解决方案

你几乎在那里,但你想要设置 color 而不是 fillColor (而不是标记) - 我将它添加到图表声明中:

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

从列数据中删除状态在这个小提琴中工作。



而且,是的,那不是很明确的文档...


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.

解决方案

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 ...

这篇关于Highcharts悬停时更改列颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆