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 2020/12/03 05:25:03 UTC

[incubator-echarts] 01/01: fix(decal): fix types and improve test cases

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

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

commit 128900ebd14ea34b023f7634b0c9605159c1c7e1
Author: Ovilia <zw...@gmail.com>
AuthorDate: Thu Dec 3 11:48:14 2020 +0800

    fix(decal): fix types and improve test cases
---
 src/util/types.ts       |   6 +--
 test/aria-line-bar.html |   2 +-
 test/aria-pie.html      |   2 +-
 test/decal.html         | 117 ++++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 119 insertions(+), 8 deletions(-)

diff --git a/src/util/types.ts b/src/util/types.ts
index db5d312..94e53a4 100644
--- a/src/util/types.ts
+++ b/src/util/types.ts
@@ -661,7 +661,7 @@ export type DecalDashArrayX = number | (number | number[])[];
 export type DecalDashArrayY = number | number[];
 export interface DecalObject {
     // 'image', 'triangle', 'diamond', 'pin', 'arrow', 'line', 'rect', 'roundRect', 'square', 'circle'
-    symbol?: string | (string | string[])
+    symbol?: string | string[]
 
     // size relative to the dash bounding box; valued from 0 to 1
     symbolSize?: number
@@ -679,10 +679,10 @@ export interface DecalObject {
     dashArrayY?: DecalDashArrayY
 
     // in radians; valued from -Math.PI to Math.PI
-    rotation?: number,
+    rotation?: number
 
     // boundary of largest tile width
-    maxTileWidth?: number,
+    maxTileWidth?: number
     // boundary of largest tile height
     maxTileHeight?: number
 };
diff --git a/test/aria-line-bar.html b/test/aria-line-bar.html
index 3bcb55a..cf8091d 100644
--- a/test/aria-line-bar.html
+++ b/test/aria-line-bar.html
@@ -76,7 +76,7 @@ under the License.
 
                 chart.setOption({
                     aria: {
-                        show: true,
+                        enabled: true,
                         series: {
                             multiple: {
                                 prefix: '{seriesCount}个图表系列组成了该图表。'
diff --git a/test/aria-pie.html b/test/aria-pie.html
index d54806f..c7fe3ee 100644
--- a/test/aria-pie.html
+++ b/test/aria-pie.html
@@ -76,7 +76,7 @@ under the License.
 
                 chart.setOption({
                     aria: {
-                        show: true
+                        enabled: true
                     },
                     title : {
                         text: '某站点用户访问来源',
diff --git a/test/decal.html b/test/decal.html
index 290b8a5..b85c03b 100644
--- a/test/decal.html
+++ b/test/decal.html
@@ -112,6 +112,7 @@ under the License.
         <div id="main-custom-series"></div>
 
         <div id="main-fruit"></div>
+        <div id="main-newspaper"></div>
 
 
 
@@ -342,7 +343,7 @@ under the License.
                 right: 20
             },
             aria: {
-                show: true
+                enabled: true
             },
             animation: false
         };
@@ -858,13 +859,13 @@ under the License.
                 series: [{
                     type: 'pie',
                     data: [{
-                        value: 100,
+                        value: 110,
                         name: 'Grapes'
                     }, {
                         value: 80,
                         name: 'Apples'
                     }, {
-                        value: 70,
+                        value: 40,
                         name: 'Bananas'
                     }],
                     label: {
@@ -919,6 +920,116 @@ under the License.
         </script>
 
 
+        <script>
+            require(['echarts'/*, 'map/js/china' */], function (echarts) {
+                var option = {
+                    series: [{
+                        type: 'bar',
+                        name: 'Apples',
+                        data: [108, 26, 39, 24],
+                        itemStyle: {
+                            borderColor: 'black',
+                            borderWidth: 2
+                        }
+                    }, {
+                        type: 'bar',
+                        name: 'Oranges',
+                        data: [23, 40, 60, 70],
+                        itemStyle: {
+                            borderColor: 'black',
+                            borderWidth: 2
+                        }
+                    }, {
+                        type: 'bar',
+                        name: 'Bananas',
+                        data: [129, 40, 40, 50],
+                        itemStyle: {
+                            borderColor: 'black',
+                            borderWidth: 2
+                        }
+                    }, {
+                        type: 'bar',
+                        name: 'Pears',
+                        data: [40, 60, 50, 89],
+                        itemStyle: {
+                            borderColor: 'black',
+                            borderWidth: 2
+                        }
+                    }],
+
+                    xAxis: {
+                        data: ['Q1', 'Q2', 'Q3', 'Q4'],
+                        axisLine: {
+                            color: 'black'
+                        },
+                        axisTick: {
+                            color: 'black'
+                        },
+                        axisLabel: {
+                            color: 'black'
+                        }
+                    },
+                    yAxis: {
+                        axisLine: {
+                            color: 'black'
+                        },
+                        axisTick: {
+                            color: 'black'
+                        },
+                        axisLabel: {
+                            color: 'black'
+                        },
+                        splitLine: {
+                            lineStyle: {
+                                color: 'black',
+                                type: 'dashed'
+                            }
+                        }
+                    },
+
+                    aria: {
+                        decal: {
+                            show: true,
+                            decals: [{
+                                dashArrayX: 0,
+                                dashArrayY: 0,
+                                color: 'black'
+                            }, {
+                                dashArrayX: 0,
+                                dashArrayY: 0,
+                                color: 'black'
+                            }, {
+                                dashArrayX: [1, 0],
+                                dashArrayY: [2, 5],
+                                symbolSize: 1,
+                                rotation: Math.PI / 6,
+                                color: 'black'
+                            }, {
+                                symbol: 'circle',
+                                dashArrayX: [[8, 8], [0, 8, 8, 0]],
+                                dashArrayY: [6, 0],
+                                symbolSize: 0.8,
+                                color: 'black'
+                            }]
+                        }
+                    },
+
+                    color: ['white', 'black', 'white', 'white']
+                };
+
+                var chart = testHelper.create(echarts, 'main-newspaper', {
+                    title: [
+                        'Two-color decals'
+                    ],
+                    option: option
+                    // height: 300,
+                    // buttons: [{text: 'btn-txt', onclick: function () {}}],
+                    // recordCanvas: true,
+                });
+            });
+            </script>
+
+
 
     </body>
 </html>


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