我有一个 Highcharts 散点图。图表对象的一些细节如下:
plotOptions: {
scatter: {
lineWidth:1,
marker: {
radius: 1,
symbol:'circle',
fillColor: '#800000',
states: {
hover: {
enabled: true,
radius:0,
radiusPlus:2,
lineColor: '#ff0000',
fillColor: '#ff0000'
}
}
},
states: {
hover: {
halo:false,
lineWidthPlus:2,
}
}
}
}
完整的工作示例是here . 将系列悬停时,我需要更改线条颜色,但我做不到。这可能吗?
最佳答案
这可以通过事件轻松实现。
您只需要在用户将鼠标悬停在系列上时更新系列颜色属性
events: {
mouseOver: function () {
this.chart.series[this.index].update({
color: 'red'
});
},
mouseOut: function () {
this.chart.series[this.index].update({
color: "#b0b0b0"
});
}
}
这将更改悬停点的系列的颜色。
希望对您有所帮助。
关于javascript - Highcharts:悬停散点图系列时如何更改线条颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34575870/