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 2020/10/26 08:47:05 UTC

[incubator-echarts] branch next updated: fix(sunburst): fix label show not work bug.

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/next by this push:
     new d081f84  fix(sunburst): fix label show not work bug.
d081f84 is described below

commit d081f84ec4b9d73121528768d8775413308920d1
Author: pissang <bm...@gmail.com>
AuthorDate: Mon Oct 26 16:46:22 2020 +0800

    fix(sunburst): fix label show not work bug.
---
 src/chart/sunburst/SunburstPiece.ts | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts
index 04f8134..e7551ea 100644
--- a/src/chart/sunburst/SunburstPiece.ts
+++ b/src/chart/sunburst/SunburstPiece.ts
@@ -170,13 +170,16 @@ class SunburstPiece extends graphic.Sector {
         const sector = this;
         const label = sector.getTextContent();
         const dataIndex = this.node.dataIndex;
+        const labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;
+        const isNormalShown = normalLabelModel.get('show')
+            && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);
+        label.ignore = !isNormalShown;
 
         // TODO use setLabelStyle
         zrUtil.each(DISPLAY_STATES, (stateName) => {
 
             const labelStateModel = stateName === 'normal' ? itemModel.getModel('label')
                 : itemModel.getModel([stateName, 'label']);
-            const labelMinAngle = labelStateModel.get('minAngle') / 180 * Math.PI;
             const isNormal = stateName === 'normal';
 
             const state = isNormal ? label : label.ensureState(stateName);
@@ -190,7 +193,10 @@ class SunburstPiece extends graphic.Sector {
                 state.style.text = text;
             }
             // Not displaying text when angle is too small
-            state.ignore = labelMinAngle != null && Math.abs(angle) < labelMinAngle;
+            const isShown = labelStateModel.get('show');
+            if (isShown != null && !isNormal) {
+                state.ignore = !isShown;
+            }
 
             const labelPosition = getLabelAttr(labelStateModel, 'position');
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org