You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2019/11/20 02:41:52 UTC
[incubator-echarts] branch master updated: fix(legend): fix
highlight state after inverseselect #11480 (#11547)
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/master by this push:
new 1df68e7 fix(legend): fix highlight state after inverseselect #11480 (#11547)
1df68e7 is described below
commit 1df68e7829e889d57c3b14f131012df3cc512520
Author: Saniac <Sn...@users.noreply.github.com>
AuthorDate: Wed Nov 20 10:41:24 2019 +0800
fix(legend): fix highlight state after inverseselect #11480 (#11547)
---
src/component/legend/LegendView.js | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/component/legend/LegendView.js b/src/component/legend/LegendView.js
index 3556038..9e6806b 100644
--- a/src/component/legend/LegendView.js
+++ b/src/component/legend/LegendView.js
@@ -204,7 +204,7 @@ export default echarts.extendComponentView({
selectMode
);
- itemGroup.on('click', curry(dispatchSelectAction, name, api))
+ itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId))
.on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))
.on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
@@ -238,7 +238,7 @@ export default echarts.extendComponentView({
);
// FIXME: consider different series has items with the same name.
- itemGroup.on('click', curry(dispatchSelectAction, name, api))
+ itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId))
// Should not specify the series name, consider legend controls
// more than one pie series.
.on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId))
@@ -518,11 +518,15 @@ function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, i
return symbol.setStyle(itemStyle);
}
-function dispatchSelectAction(name, api) {
+function dispatchSelectAction(name, dataName, api, excludeSeriesId) {
+ // downplay before unselect
+ dispatchDownplayAction(name, dataName, api, excludeSeriesId);
api.dispatchAction({
type: 'legendToggleSelect',
name: name
});
+ // highlight after select
+ dispatchHighlightAction(name, dataName, api, excludeSeriesId);
}
function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org