如何在 Highcharts 中更改悬停点的不透明度?
我目前正在使用以下内容,尽管它非常缓慢且滞后,因为我正在运行点十六进制颜色以将其转换为 RGBA。我正在使用 heatmap图表类型。
plotOptions: {
series: {
point: {
events: {
mouseOver: function () {
var newColor = hexToRgb(this.color);
var formattedColor = "rgba(" + newColor.r + "," + newColor.g + "," + newColor.b + ",0.7)";
this.oldColor = this.color;
this.update({
color: formattedColor
});
},
mouseOut: function () {
this.update({
color: this.oldColor,
});
}
}
}
}
}
有没有更简单的方法?
最佳答案
在提到的 heatmap demo page (themed one) 中存在错觉.
似乎主题只应用了第一个 colors
值作为热图点的悬停颜色。
所以尝试添加这个:
colors: [null],
演示:http://jsfiddle.net/uteqzxfn/1/
如有必要,您可以更改由 colors
值覆盖的边框颜色。
plotOptions: {
series: {
borderColor: '#303030'
}
},
关于javascript - 如何在悬停时更改 highcharts 不透明度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29201324/