You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2021/05/19 06:45:40 UTC

[echarts] 01/01: fix(label): ensure the label of the temporary symbol is in front of line and area polygon. - resolves #14541 - resolves #14735

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

wangzx pushed a commit to branch fix-label
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit ea7c1c26dec0b73fe89b1f967bf02b138f3bf8be
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed May 19 14:42:27 2021 +0800

    fix(label): ensure the label of the temporary symbol is in front of line and area polygon.
    - resolves #14541
    - resolves #14735
---
 src/chart/line/LineView.ts | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts
index 84b8fde..d14424b 100644
--- a/src/chart/line/LineView.ts
+++ b/src/chart/line/LineView.ts
@@ -833,17 +833,20 @@ class LineView extends ChartView {
                 if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {
                     return;
                 }
+                const zlevel = seriesModel.get('zlevel');
+                const z = seriesModel.get('z');
                 symbol = new SymbolClz(data, dataIndex);
                 symbol.x = x;
                 symbol.y = y;
-                symbol.setZ(
-                    seriesModel.get('zlevel'),
-                    seriesModel.get('z')
-                );
+                symbol.setZ(zlevel, z);
 
-                // ensure label text of the temporal symbol is on the top of line and area polygon
+                // ensure label text of the temporary symbol is in front of line and area polygon
                 const symbolLabel = symbol.getSymbolPath().getTextContent();
-                symbolLabel && (symbolLabel.z2 = this._polyline.z2 + 1);
+                if (symbolLabel) {
+                    symbolLabel.zlevel = zlevel;
+                    symbolLabel.z = z;
+                    symbolLabel.z2 = this._polyline.z2 + 1;
+                }
 
                 (symbol as SymbolExtended).__temp = true;
                 data.setItemGraphicEl(dataIndex, symbol);

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