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

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


The following commit(s) were added to refs/heads/master by this push:
     new d5de58c  enhance test case.
d5de58c is described below

commit d5de58c84cf2c437b21396bedacc5db1330a17ea
Author: sushuang <sushuang0...@gmail.com>
AuthorDate: Sat Apr 21 07:11:33 2018 +0800

    enhance test case.
---
 src/chart/scatter/ScatterSeries.js |   4 +-
 test/axis-boundaryGap.html         | 140 ++++++++++++++++++++++++++++++-------
 test/axis-extrema.html             |  20 +++---
 3 files changed, 126 insertions(+), 38 deletions(-)

diff --git a/src/chart/scatter/ScatterSeries.js 
b/src/chart/scatter/ScatterSeries.js
index 68cb81b..3c7f5d6 100644
--- a/src/chart/scatter/ScatterSeries.js
+++ b/src/chart/scatter/ScatterSeries.js
@@ -68,9 +68,9 @@ export default SeriesModel.extend({
         itemStyle: {
             opacity: 0.8
             // color: 各异
-        },
+        }
 
-        progressive: null
+        // progressive: null
     }
 
 });
\ No newline at end of file
diff --git a/test/axis-boundaryGap.html b/test/axis-boundaryGap.html
index 4eb50b0..7009dfe 100644
--- a/test/axis-boundaryGap.html
+++ b/test/axis-boundaryGap.html
@@ -6,26 +6,17 @@
         <script src="lib/config.js"></script>
         <script src="lib/jquery.min.js"></script>
         <script src="lib/facePrint.js"></script>
+        <script src="lib/facePrint.js"></script>
+        <script src="lib/testHelper.js"></script>
         <meta name="viewport" content="width=device-width, initial-scale=1" />
         <link rel="stylesheet" href="lib/reset.css">
     </head>
     <body>
         <style>
-            h1 {
-                line-height: 60px;
-                background: #140;
-                text-align: center;
-                font-weight: bold;
-                color: #eee;
-                font-size: 14px;
-            }
-            .chart {
-                height: 200px;
-            }
         </style>
 
-        <h1>default {boundaryGap:true, alignWithLabel: false}, in category 
axis, axis tick and label should be consistent</h1>
         <div class="chart" id="a"></div>
+        <div class="chart" id="b"></div>
 
 
 
@@ -37,18 +28,7 @@
 
         <script>
 
-            require([
-                'echarts'
-                // 'echarts/chart/line',
-                // 'echarts/chart/bar',
-                // 'echarts/chart/candlestick',
-                // 'echarts/component/grid',
-                // 'echarts/component/graphic',
-                // 'echarts/component/legend',
-                // 'echarts/component/tooltip',
-                // 'echarts/component/toolbox',
-                // 'echarts/component/dataZoom'
-            ], function (echarts) {
+            require(['echarts'], function (echarts) {
 
                 var axisData = [
                     "2013/1/24", "2013/1/25", "2013/1/28", "2013/1/29", 
"2013/1/30",
@@ -136,10 +116,118 @@
                     ]
                 };
 
-                chart = myChart = echarts.init(document.getElementById('a'));
-                chart.setOption(option);
+                testHelper.create(echarts, 'a', {
+                    title: [
+                        'default {boundaryGap:true, alignWithLabel: false}, in 
category axis, axis tick and label should be consistent'
+                    ],
+                    height: 200,
+                    option: option
+                });
+
             });
 
         </script>
+
+
+
+
+        <script>
+
+            require(['echarts'], function (echarts) {
+
+                var gridLeft = 50;
+                var gridRight = 20;
+                var option = {
+                    tooltip : {
+                        trigger: 'axis',
+                    },
+                    legend: {
+                    },
+                    dataZoom: [{
+                    }, {
+                        type: 'inside'
+                    }],
+                    grid: {
+                        id: 'cartesian',
+                        left: gridLeft,
+                        right: gridRight
+                    },
+                    xAxis: {
+                        min: 500,
+                        max: 2000
+                    },
+                    yAxis: {
+                        min: 0,
+                        max: 200
+                    },
+                    series: [
+                        {
+                            type:'line',
+                            symbolSize: 20,
+                            data:[{
+                                value: [2000, 100],
+                                itemStyle: {
+                                    color: 'red'
+                                }
+                            }, {
+                                value: [1000, 200],
+                                itemStyle: {
+                                    color: 'red'
+                                }
+                            }, {
+                                value: [500, 0],
+                                itemStyle: {
+                                    color: 'red'
+                                }
+                            }, {
+                                value: [2001, 100],
+                                itemStyle: {
+                                    color: 'green'
+                                }
+                            }]
+                        }
+                    ]
+                };
+
+                var chart = testHelper.create(echarts, 'b', {
+                    title: [
+                        'Three red symbol on grid edge should always be 
displayed',
+                        'One green symbol out of the grid should not be 
displayed'
+                    ],
+                    option: option,
+                    info: {
+                        xAxis: option.xAxis,
+                        yAxis: option.yAxis
+                    }
+                });
+
+                var delta = 7;
+                chart && setInterval(function () {
+                    var width = chart.getWidth();
+                    if (
+                        (delta > 0 && gridRight > width - gridLeft - 10)
+                        || (delta < 0 && gridRight < 10)
+                    ) {
+                        delta = -delta;
+                    }
+
+                    gridRight += delta;
+
+                    chart.setOption({
+                        grid: {
+                            id: 'cartesian',
+                            right: gridRight
+                        }
+                    });
+                }, 100);
+            });
+
+        </script>
+
+
+
+
+
+
     </body>
 </html>
\ No newline at end of file
diff --git a/test/axis-extrema.html b/test/axis-extrema.html
index cf10d2c..b11644b 100644
--- a/test/axis-extrema.html
+++ b/test/axis-extrema.html
@@ -300,10 +300,10 @@
                 xAxis: {
                     data: ['类目1', '类目2', '类目3', '类目4', '类目5'],
                     min: function (value) {
-                        return value + 20;
+                        return value.min - 20;
                     },
                     max: function (value) {
-                        return value + 20;
+                        return value.max + 20;
                     },
                     axisTick: {
                         interval: 0
@@ -420,10 +420,10 @@
                 },
                 xAxis: {
                     min: function (value) {
-                        return value + 20;
+                        return value.min - 20;
                     },
                     max: function (value) {
-                        return value + 20;
+                        return value.max + 20;
                     }
                 },
                 yAxis: {},
@@ -547,10 +547,10 @@
                 xAxis: {
                     type: 'time',
                     min: function (value) {
-                        return value + 20;
+                        return value.min - 20 * 24 * 3600 * 1000;
                     },
                     max: function (value) {
-                        return value + 20;
+                        return value.max + 20 * 24 * 3600 * 1000;
                     }
                 },
                 yAxis: {},
@@ -634,10 +634,10 @@
                 polar: {},
                 radiusAxis: {
                     min: function (value) {
-                        return value + 20;
+                        return value.min - 20;
                     },
                     max: function (value) {
-                        return value + 20;
+                        return value.max + 20;
                     },
                     data: ['类目1', '类目2', '类目3', '类目4', '类目5']
                 },
@@ -764,10 +764,10 @@
                 singleAxis: {
                     type: 'category',
                     min: function (value) {
-                        return value + 20;
+                        return value.min - 20;
                     },
                     max: function (value) {
-                        return value + 20;
+                        return value.max + 20;
                     },
                     data: ['类目1', '类目2', '类目3', '类目4', '类目5']
                 },

-- 
To stop receiving notification emails like this one, please contact
sushu...@apache.org.

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

Reply via email to