I want to set the visibility of labels to false within Echarts, and I can achieve this with the following:
label: {
show: false
}
However, I have another setting:
emphasis: {
focus: "series"
}
With this, the bars in the other series also become highlighted. The issue is that I cannot see their labels.
In summary, when the visibility of labels is set to false, I want to be able to see the labels of the highlighted bars in the other series when emphasized.
I tried this:
label: {
show: false,
emphasis: {
show: true,
focus: "series",
}
}
2
Answers
You can listen to chart events and change your chart option accordingly. Here is a small example where the label visability is changed when the mouse hovers over a series item and when it stops hovering over (mouseover / mouseout):
Visit https://echarts.apache.org/zh/option.html#series-line.selectedMode
And try the setting with selectedMode and select like below,and make sure the selectMode must be "series"