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 2022/06/20 03:36:31 UTC

[echarts] 01/01: fix(line): set default z/zlevel for temporary symbol to avoid warnings.

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

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

commit 563bcb1c932689f9f9cb59a44800913489dbc690
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Mon Jun 20 11:31:53 2022 +0800

    fix(line): set default z/zlevel for temporary symbol to avoid warnings.
---
 src/chart/line/LineView.ts          |  4 ++--
 test/line-case.html                 | 34 ++++++++++++++++++++++++++++++++++
 test/runTest/actions/__meta__.json  |  4 ++--
 test/runTest/actions/line-case.json |  2 +-
 4 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts
index 493c17d18..45414fb38 100644
--- a/src/chart/line/LineView.ts
+++ b/src/chart/line/LineView.ts
@@ -947,8 +947,8 @@ class LineView extends ChartView {
                 if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {
                     return;
                 }
-                const zlevel = seriesModel.get('zlevel');
-                const z = seriesModel.get('z');
+                const zlevel = seriesModel.get('zlevel') || 0;
+                const z = seriesModel.get('z') || 0;
                 symbol = new SymbolClz(data, dataIndex);
                 symbol.x = x;
                 symbol.y = y;
diff --git a/test/line-case.html b/test/line-case.html
index aa54d7c77..8d76e8e41 100644
--- a/test/line-case.html
+++ b/test/line-case.html
@@ -41,6 +41,7 @@ under the License.
         <div id="main1"></div>
         <div id="main2"></div>
         <div id="main3"></div>
+        <div id="main4"></div>
 
 
 
@@ -610,6 +611,39 @@ under the License.
             });
         </script>
 
+        <script>
+            require([
+                'echarts'
+            ], function (echarts) {
+                var option = {
+                    xAxis: {
+                        type: 'category',
+                        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+                    },
+                    yAxis: {
+                        type: 'value'
+                    },
+                    tooltip: {
+                        trigger: 'axis'
+                    },
+                    series: [
+                        {
+                            data: [150, 230, 224, 218, 135, 147, 260],
+                            type: 'line',
+                            showSymbol: false
+                        }
+                    ]
+                };
+                var chart = testHelper.create(echarts, 'main4', {
+                    title: [
+                        'Should have no following warnings when axisPointer is visible',
+                        'z / z2 / zlevel of displayable is invalid, which may cause unexpected errors'
+                    ],
+                    option: option
+                });
+            });
+        </script>
+
 
     </body>
 </html>
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 473fa64b8..388c569e0 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -121,7 +121,7 @@
   "line-animation": 1,
   "line-animation-update": 3,
   "line-boldWhenHover": 1,
-  "line-case": 1,
+  "line-case": 2,
   "line-crash": 1,
   "line-endLabel": 1,
   "line-sampling": 2,
@@ -189,8 +189,8 @@
   "tooltip-valueFormatter": 3,
   "tree-image": 1,
   "tree-legend": 1,
-  "tree-radial": 2,
   "tree-polyline": 1,
+  "tree-radial": 2,
   "treemap-action": 3,
   "treemap-disk": 3,
   "treemap-disk2": 3,
diff --git a/test/runTest/actions/line-case.json b/test/runTest/actions/line-case.json
index 318b5d1ac..3de881547 100644
--- a/test/runTest/actions/line-case.json
+++ b/test/runTest/actions/line-case.json
@@ -1 +1 @@
-[{"name":"Action 1","ops":[{"type":"mousedown","time":264,"x":423,"y":226},{"type":"mouseup","time":353,"x":423,"y":226},{"time":354,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":426,"x":425,"y":227},{"type":"mousemove","time":626,"x":456,"y":261},{"type":"mousemove","time":826,"x":499,"y":322},{"type":"mousedown","time":936,"x":499,"y":322},{"type":"mousemove","time":1027,"x":495,"y":317},{"type":"mousemove","time":1231,"x":443,"y":252},{"type":"mouseup","time":1403," [...]
\ No newline at end of file
+[{"name":"Action 1","ops":[{"type":"mousedown","time":264,"x":423,"y":226},{"type":"mouseup","time":353,"x":423,"y":226},{"time":354,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":426,"x":425,"y":227},{"type":"mousemove","time":626,"x":456,"y":261},{"type":"mousemove","time":826,"x":499,"y":322},{"type":"mousedown","time":936,"x":499,"y":322},{"type":"mousemove","time":1027,"x":495,"y":317},{"type":"mousemove","time":1231,"x":443,"y":252},{"type":"mouseup","time":1403," [...]
\ No newline at end of file


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