当将一 block 饼图悬停在其上时,我希望它更改为指定的悬停颜色,然后在鼠标离开该切片后更改回其原始颜色。
这里的文档( http://api.highcharts.com/highcharts#plotOptions.series.marker.states.hover )使得以下内容看起来可行,但我没有任何运气:
http://jsfiddle.net/pixeloco/ztJkb/3/
plotOptions: {
series: {
marker: {
states: {
hover: {
fillColor: 'black'
}
}
}
}
},
我找到了这个解决方案http://jsfiddle.net/r6p7E/6/ ,但它要求所有切片的颜色相同。有没有办法让多色图表的切片在悬停时改变颜色?
最佳答案
看起来您需要这些选项:
series: {
states: {
hover: {
enabled: false
}
},
point: {
events: {
mouseOver: function () {
this.options.oldColor = this.color;
this.graphic.attr("fill", "black");
},
mouseOut: function () {
this.graphic.attr("fill", this.options.oldColor);
}
}
},
}
关于colors - highcharts:悬停时更改饼图切片的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18474108/