提交 1df68e78 编写于 作者: S Saniac 提交者: Yi Shen

fix(legend): fix highlight state after inverseselect #11480 (#11547)

上级 5a8ee574
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册