From f794677dedec13406d8d7b05d533436885fd1201 Mon Sep 17 00:00:00 2001 From: ChepteaCatalin <71984989+ChepteaCatalin@users.noreply.github.com> Date: Thu, 28 Sep 2023 17:35:36 +0300 Subject: [PATCH] bug(label): hide labelLine when emphasis.labelLine.show is false. close #19160 --- src/label/labelGuideHelper.ts | 2 ++ test/pie-label.html | 51 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/src/label/labelGuideHelper.ts b/src/label/labelGuideHelper.ts index fdb70665e1..3d468ca1ff 100644 --- a/src/label/labelGuideHelper.ts +++ b/src/label/labelGuideHelper.ts @@ -593,6 +593,7 @@ export function setLabelLineStyle( defaultStyle?: Polyline['style'] ) { let labelLine = targetEl.getTextGuideLine(); + labelLine && labelLine.ensureState('emphasis'); const label = targetEl.getTextContent(); if (!label) { // Not show label line if there is no label. @@ -627,6 +628,7 @@ export function setLabelLineStyle( // Create labelLine if not exists if (!labelLine) { labelLine = new Polyline(); + labelLine.ensureState('emphasis'); targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created. // NOTE: NORMAL should always been the first! diff --git a/test/pie-label.html b/test/pie-label.html index 048a703110..75db5f640b 100644 --- a/test/pie-label.html +++ b/test/pie-label.html @@ -53,6 +53,7 @@
+ + +