Skip to content

Commit

Permalink
fix(plugin-chart-echarts): fix unnecessary highlight (#1052)
Browse files Browse the repository at this point in the history
* fix(plugin-chart-echarts): fix unnecessary highlight

* simplify code

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
  • Loading branch information
2 people authored and zhaoyongjie committed Nov 26, 2021
1 parent 1dc7538 commit cca4b74
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ export default function Echart({
type: 'downplay',
dataIndex: previousSelection.current.filter(value => !currentSelection.includes(value)),
});
chartRef.current.dispatchAction({
type: 'highlight',
dataIndex: currentSelection,
});
if (currentSelection.length) {
chartRef.current.dispatchAction({
type: 'highlight',
dataIndex: currentSelection,
});
}
previousSelection.current = currentSelection;
}, [echartOptions, eventHandlers, selectedValues]);

Expand Down

0 comments on commit cca4b74

Please sign in to comment.