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/14 09:45:34 UTC

[incubator-echarts] 03/03: test(polar): add test for polar bars with roundCap

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

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

commit e50f0498000bac05c95cf514bb10387f92630abd
Author: Ovilia <zw...@gmail.com>
AuthorDate: Mon Oct 14 17:43:55 2019 +0800

    test(polar): add test for polar bars with roundCap
---
 test/polar-rounded.html                 | 256 ++++++++++++++++++++++++++++++++
 test/runTest/actions/__meta__.json      |   3 +-
 test/runTest/actions/polar-rounded.json |   1 +
 3 files changed, 259 insertions(+), 1 deletion(-)

diff --git a/test/polar-rounded.html b/test/polar-rounded.html
new file mode 100644
index 0000000..53585a5
--- /dev/null
+++ b/test/polar-rounded.html
@@ -0,0 +1,256 @@
+<!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>
+
+        <div id="main3"></div>
+
+
+
+        <script>
+        require(['echarts'], function (echarts) {
+            var option =  {
+                xAxis: {
+                    type: 'category',
+                    data: ['A'],
+                    show: false
+                },
+                yAxis: {
+                    show: false
+                },
+                series: {
+                    type: 'line',
+                    symbol: 'sausage',
+                    symbolSize: 120,
+                    data: [1]
+                },
+                animation: false
+            };
+
+            var chart = testHelper.create(echarts, 'main0', {
+                title: [
+                    'Sausage shape'
+                ],
+                option: option
+            });
+        });
+        </script>
+
+
+
+
+        <script>
+        require(['echarts'], function (echarts) {
+            var option = {
+                angleAxis: {
+                    max: 2,
+                    startAngle: 30,
+                    splitLine: {
+                        show: false
+                    }
+                },
+                radiusAxis: {
+                    type: 'category',
+                    data: ['v', 'w', 'x', 'y', 'z'],
+                    z: 10
+                },
+                polar: {
+                },
+                series: [{
+                    type: 'bar',
+                    data: [4, 3, 2, 1, 0],
+                    coordinateSystem: 'polar',
+                    name: 'Without Round Cap',
+                    color: 'rgba(200, 0, 0, 0.5)',
+                    itemStyle: {
+                        borderColor: 'red',
+                        borderWidth: 1
+                    }
+                }, {
+                    type: 'bar',
+                    data: [4, 3, 2, 1, 0],
+                    coordinateSystem: 'polar',
+                    name: 'With Round Cap',
+                    roundCap: true,
+                    color: 'rgba(0, 200, 0, 0.5)',
+                    itemStyle: {
+                        borderColor: 'green',
+                        borderWidth: 1
+                    }
+                }],
+                legend: {
+                    show: true,
+                    data: ['Without Round Cap', 'With Round Cap']
+                }
+            };
+
+            var chart = testHelper.create(echarts, 'main1', {
+                title: [
+                    'Polar bar with and without round cap on rotated axis'
+                ],
+                option: option
+            });
+        });
+        </script>
+
+
+        <script>
+        require(['echarts'], function (echarts) {
+            var data1 = [];
+            var data2 = [];
+            for (var i = 1; i <= 6; ++i) {
+                data1.push(i);
+                data2.push(6 - i);
+            }
+
+            var option = {
+                angleAxis: {
+                    max: 5
+                },
+                radiusAxis: {
+                    type: 'category',
+                    data: data1,
+                    z: 10
+                },
+                polar: {
+                },
+                series: [{
+                    type: 'bar',
+                    data: data1,
+                    coordinateSystem: 'polar',
+                    name: 'A',
+                    roundCap: true,
+                    color: 'rgba(200, 0, 0, 0.5)',
+                    itemStyle: {
+                        borderColor: 'red',
+                        borderWidth: 1
+                    }
+                }, {
+                    type: 'bar',
+                    data: data2,
+                    coordinateSystem: 'polar',
+                    name: 'B',
+                    roundCap: true,
+                    color: 'rgba(0, 200, 0, 0.5)',
+                    itemStyle: {
+                        borderColor: 'green',
+                        borderWidth: 1
+                    }
+                }],
+                legend: {
+                    show: true,
+                    data: ['A', 'B']
+                },
+                tooltip: {
+                    show: true
+                }
+            };
+
+            var chart = testHelper.create(echarts, 'main2', {
+                title: [
+                    'Polar bar with round cap'
+                ],
+                option: option
+            });
+        });
+        </script>
+
+
+        <script>
+        require(['echarts'], function (echarts) {
+            var option = {
+                angleAxis: {
+                    max: 5
+                },
+                radiusAxis: {
+                    type: 'category',
+                    data: ['-', 'a'],
+                    z: 10
+                },
+                polar: {
+                },
+                series: [{
+                    type: 'bar',
+                    data: ['-', 1],
+                    coordinateSystem: 'polar',
+                    name: 'A',
+                    roundCap: true,
+                    color: 'rgba(200, 0, 0, 0.5)',
+                    itemStyle: {
+                        borderColor: 'red',
+                        borderWidth: 1
+                    }
+                }],
+                legend: {
+                    show: true,
+                    data: ['A']
+                },
+                tooltip: {
+                    show: true
+                }
+            };
+
+            var chart = testHelper.create(echarts, 'main3', {
+                title: [
+                    'Click button and check animation',
+                    'Data add 3 by each click; data change to 1 when bigger than 10'
+                ],
+                option: option,
+                buttons: [{
+                    text: 'Change data',
+                    onclick: function () {
+                        if (option.series[0].data[1] > 10) {
+                            option.series[0].data[1] = 1;
+                        }
+                        else {
+                            option.series[0].data[1] += 3;
+                        }
+                        chart.setOption(option);
+                    }
+                }]
+            });
+        });
+        </script>
+
+    </body>
+</html>
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 723bed1..5a2dcc4 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,
+  "polar-rounded": 1
 }
\ No newline at end of file
diff --git a/test/runTest/actions/polar-rounded.json b/test/runTest/actions/polar-rounded.json
new file mode 100644
index 0000000..169b11b
--- /dev/null
+++ b/test/runTest/actions/polar-rounded.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousemove","time":409,"x":85,"y":209},{"type":"mousemove","time":618,"x":70,"y":180},{"type":"mousedown","time":737,"x":69,"y":180},{"type":"mousemove","time":843,"x":69,"y":180},{"type":"mouseup","time":860,"x":69,"y":180},{"time":861,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1719,"x":69,"y":180},{"type":"mouseup","time":1837,"x":69,"y":180},{"time":1838,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":2790,"x":6 [...]
\ 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