我有一个散点图,其中根据某些条件用不同颜色绘制了一些点。当我选择一个点时,该点的颜色默认变为白色。我需要保留所选点的颜色,因为外部颜色和内部颜色可以是任何颜色,甚至白色也可以。
我已经尝试过这段代码,但它不起作用,请帮助我,因为我对 highcharts 不太熟悉。在此代码中,我尝试将选定的点线颜色设置为绿色。
plotOptions: {
series: {
cropThreshold: maxCropThreshold,
allowPointSelect: true,
point: {
events: {
select: function (e) {
mychart.options.plotOptions.series.marker.states.select.lineColor="green";
},
unselect: function(){
}
}
},
最佳答案
使用下面的代码,我能够让它工作
point: {
events: {
select: function (e) {
//to update line color
this.update({
marker: {
states: {
select:{
lineWidth: 1.5,
lineColor: this.color
}
}
}
}, true);
}
关于javascript - 动态更改 HighCharts 中选定点的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31200943/