You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2019/10/08 07:30:15 UTC

[incubator-echarts] branch fix-10945 created (now 19258d9)

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

ovilia pushed a change to branch fix-10945
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 19258d9  test(gauge): add visual test cases for gauge #10945

This branch includes the following new commits:

     new 9d8cff5  fix(gauge): update data with dataset #10945
     new 5c5ea1b  test(gauge): add test case for gauge #10945
     new 19258d9  test(gauge): add visual test cases for gauge #10945

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-echarts] 01/03: fix(gauge): update data with dataset #10945

Posted by ov...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9d8cff58d6ccdffc0db999b1b77fee9fc62c126d
Author: Ovilia <zw...@gmail.com>
AuthorDate: Tue Oct 8 15:26:42 2019 +0800

    fix(gauge): update data with dataset #10945
---
 src/chart/gauge/GaugeSeries.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/chart/gauge/GaugeSeries.js b/src/chart/gauge/GaugeSeries.js
index d6b22af..f8c3e72 100644
--- a/src/chart/gauge/GaugeSeries.js
+++ b/src/chart/gauge/GaugeSeries.js
@@ -26,8 +26,8 @@ var GaugeSeries = SeriesModel.extend({
     type: 'series.gauge',
 
     getInitialData: function (option, ecModel) {
-        var dataOpt = option.data || [];
-        if (!zrUtil.isArray(dataOpt)) {
+        var dataOpt = option.data;
+        if (dataOpt && !zrUtil.isArray(dataOpt)) {
             dataOpt = [dataOpt];
         }
         option.data = dataOpt;


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


[incubator-echarts] 03/03: test(gauge): add visual test cases for gauge #10945

Posted by ov...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 19258d9de29a2ddcbbf3d72681cd7bb9f3709d24
Author: Ovilia <zw...@gmail.com>
AuthorDate: Tue Oct 8 15:29:12 2019 +0800

    test(gauge): add visual test cases for gauge #10945
---
 test/runTest/actions/__meta__.json     | 3 ++-
 test/runTest/actions/gauge-simple.json | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 723bed1..8f7c10b 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -134,5 +134,6 @@
   "dataZoom-scroll": 3,
   "map-contour": 2,
   "map-default": 1,
-  "map-labels": 1
+  "map-labels": 1,
+  "gauge-simple": 2
 }
\ No newline at end of file
diff --git a/test/runTest/actions/gauge-simple.json b/test/runTest/actions/gauge-simple.json
new file mode 100644
index 0000000..29736f2
--- /dev/null
+++ b/test/runTest/actions/gauge-simple.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousemove","time":613,"x":136,"y":595},{"type":"mousemove","time":813,"x":130,"y":264},{"type":"mousemove","time":1022,"x":89,"y":140},{"type":"mousemove","time":1223,"x":89,"y":126},{"type":"mousemove","time":1372,"x":89,"y":125},{"type":"mousemove","time":1572,"x":78,"y":101},{"type":"mousedown","time":1774,"x":75,"y":98},{"type":"mousemove","time":1807,"x":75,"y":98},{"type":"mouseup","time":1890,"x":75,"y":98},{"time":1891,"delay":400,"type":"scree [...]
\ 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


[incubator-echarts] 02/03: test(gauge): add test case for gauge #10945

Posted by ov...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5c5ea1b0cb617a23b3590bf257496fc129bed93a
Author: Ovilia <zw...@gmail.com>
AuthorDate: Tue Oct 8 15:27:57 2019 +0800

    test(gauge): add test case for gauge #10945
---
 test/gauge-simple.html | 159 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 159 insertions(+)

diff --git a/test/gauge-simple.html b/test/gauge-simple.html
new file mode 100644
index 0000000..53c0931
--- /dev/null
+++ b/test/gauge-simple.html
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+    <script src="lib/esl.js"></script>
+    <script src="lib/config.js"></script>
+    <script src="lib/jquery.min.js"></script>
+    <script src="lib/facePrint.js"></script>
+    <script src="lib/testHelper.js"></script>
+    <!-- <script src="ut/lib/canteen.js"></script> -->
+    <link rel="stylesheet" href="lib/reset.css" />
+</head>
+
+<body>
+    <style>
+    </style>
+
+
+
+    <div id="main0"></div>
+
+    <div id="main1"></div>
+
+    <div id="main2"></div>
+
+
+
+
+
+
+
+
+
+    <script>
+        require(['echarts'], function (echarts) {
+            var option = {
+                tooltip: {
+                    formatter: "{a} <br/>{b} : {c}%"
+                },
+                series: [
+                    {
+                        name: 'Pressure',
+                        type: 'gauge',
+                        detail: {formatter: '{value}%'},
+                        data: [{value: 50, name: 'score'}]
+                    }
+                ]
+            };
+
+            var chart = testHelper.create(echarts, 'main0', {
+                title: [
+                    'Simple gauge',
+                    'Value should be 88 after clicking button'
+                ],
+                option: option,
+                buttons: [{
+                    text: 'Change data', onclick: function () {
+                        option.series[0].data[0].value = 88;
+                        chart.setOption(option, true);
+                    }
+                }]
+            });
+        });
+    </script>
+
+
+
+
+
+
+    <script>
+        require(['echarts'], function (echarts) {
+            var option = {
+                tooltip: {
+                    formatter: "{a} <br/>{b} : {c}%"
+                },
+                dataset: {
+                    source: [[10], [30]]
+                },
+                series: [
+                    {
+                        name: 'Pressure',
+                        type: 'gauge',
+                        detail: {formatter: '{value}%'}
+                    }
+                ]
+            };
+
+            var chart = testHelper.create(echarts, 'main1', {
+                title: [
+                    'Gauge with dataset',
+                    'Value should be 44 and 88 after clicking button'
+                ],
+                option: option,
+                buttons: [{
+                    text: 'Change data', onclick: function () {
+                        chart.setOption({
+                            dataset: {
+                                source: [[44], [88]]
+                            }
+                        });
+                    }
+                }]
+            });
+        });
+    </script>
+
+
+
+
+    <script>
+        require(['echarts'], function (echarts) {
+            var option = {
+                tooltip: {
+                    formatter: "{a} <br/>{b} : {c}%"
+                },
+                series: [
+                    {
+                        name: 'Pressure',
+                        type: 'gauge',
+                        data: []
+                    }
+                ]
+            };
+
+            var chart = testHelper.create(echarts, 'main2', {
+                title: [
+                    'Gauge with no data, should display NaN'
+                ],
+                option: option
+            });
+        });
+    </script>
+
+</body>
+
+</html>
\ 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