pix*_*oco 3 colors hover highcharts
当一片饼图悬停在我想要更改为指定的悬停颜色时,然后在鼠标离开该切片后再更改回原始颜色.
这里的文档(http://api.highcharts.com/highcharts#plotOptions.series.marker.states.hover)使得它看起来像以下工作,但我没有任何运气:
http://jsfiddle.net/pixeloco/ztJkb/3/
plotOptions: {
series: {
marker: {
states: {
hover: {
fillColor: 'black'
}
}
}
}
},
Run Code Online (Sandbox Code Playgroud)
我找到了这个解决方案http://jsfiddle.net/r6p7E/6/,但它要求所有切片都是相同的颜色.有没有办法让多色图表的切片在悬停时改变颜色?
Art*_*oev 11
看起来你需要这些选项:
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);
}
}
},
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4801 次 |
| 最近记录: |