From 29cad06f4ed65acee7c6014dfabd92d0e36f6dfb Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Fri, 17 Jul 2020 13:52:15 +0800 Subject: [PATCH] Set sankey item visual --- src/chart/sankey/sankeyVisual.ts | 11 ++++++++--- src/component/tooltip/TooltipView.ts | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/chart/sankey/sankeyVisual.ts b/src/chart/sankey/sankeyVisual.ts index 5e1b2b63b..c3e12d695 100644 --- a/src/chart/sankey/sankeyVisual.ts +++ b/src/chart/sankey/sankeyVisual.ts @@ -49,9 +49,14 @@ export default function (ecModel: GlobalModel) { const mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); const customColor = node.getModel().get(['itemStyle', 'color']); - customColor != null - ? node.setVisual('color', customColor) - : node.setVisual('color', mapValueToColor); + if (customColor != null) { + node.setVisual('color', customColor); + node.setVisual('style', {fill: customColor}); + } + else { + node.setVisual('color', mapValueToColor); + node.setVisual('style', {fill: mapValueToColor}); + } }); } }); diff --git a/src/component/tooltip/TooltipView.ts b/src/component/tooltip/TooltipView.ts index 43fa5972c..2fc0b66a5 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -782,7 +782,7 @@ class TooltipView extends ComponentView { tooltipModel, positionExpr, x, y, tooltipContent, params, el ); tooltipContent.setContent(html, markers, tooltipModel); - tooltipContent.show(tooltipModel, el?.style.fill || nearPoint.color); + tooltipContent.show(tooltipModel, nearPoint.color); } -- GitLab