I would like to prevent background-color from changing when I hover on ECharts map. For example, see this link https://echarts.apache.org/examples/en/editor.html?c=map-usa. How can I hover over the map but the colors of the map remain unchanged. I do not want the background color changing (to yellow in this case) when I hover my mouse on any part of the map
2 Answers
6
votes
emphasis: { ... }
similar :hover
but you can silent: true
to turn events off.
Update:
silent: true
it's Echarts method that suppress events for series. In this case you can use method to suppress eventmouseover
emitted by the map. Setsilent
to true no one events will not produced. According to example from question you need add row into series option:
series: [{
name: 'USA PopEstimates',
type: 'map',
roam: true,
map: 'USA',
silent: true, // <---- here
[...]
}]
Almost all components has this method and you can suppress events in runtime.
emphasis
it's simple and easy method to define styles that will be applied to map onmouseover
event. Take a look official tutorial how to use this method:
series: [{
name: 'USA PopEstimates',
type: 'map',
roam: true,
map: 'USA',
silent: true,
emphasis: {
label: {
show: true
}
},
[...]