[英]Highcharts: how to change line color when hovering a scatterplot series
[英]formatting all the markers for the hovering series in a HighCharts scatterplot
我想在懸停該系列時更改所有標記的出現范圍(不僅是一個指向的標記),但是以下代碼( http://jsfiddle.net/fw852fy9/4/ )無法正常工作。 怎么了?
Highcharts.chart('container', {
chart: {
type: 'scatter'
},
plotOptions: {
series: {
lineWidth:1,
states: {
hover: {
lineWidthPlus: 2,
marker: {
enabled: true,
radius:3,
states: {
hover: {
fillColor:'#FF0000',
lineColor:'#00FF00',
lineWidth:3,
radius:12
}
}
}
}
},
marker: {
enabled: true,
radius:3,
states: {
hover: {
fillColor:'#FF0000',
lineColor:'#00FF00',
lineWidth:3,
radius:12
}
}
}
}
},
series: [{
data: [[29.9, 71.5], [106.4, 129.2], [144.0, 176.0], [135.6, 148.5], [216.4, 194.1], [95.6, 54.4]]
}]
});
懸停狀態僅適用於懸停的點。 如果要將所有標記都設置為懸停,則需要以編程方式更改其狀態,例如在系列鼠標懸停/鼠標懸停時。
series: [{
stickyTracking: false,
events: {
mouseOver: function() {
this.data.forEach(p => p.setState('hover'))
},
mouseOut: function() {
this.data.forEach(p => p.setState())
}
},
例如: http : //jsfiddle.net/0zu9jmca/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.