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 2020/07/28 07:44:59 UTC

[incubator-echarts] 02/02: test: added more test cases for components.

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

wangzx pushed a commit to branch more-line-type
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 85494bc90a60657d86b180db1db4c6d33d325513
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Tue Jul 28 15:42:44 2020 +0800

    test: added more test cases for components.
---
 src/component/axisPointer/viewHelper.ts |   2 +-
 src/component/title.ts                  |   4 +-
 test/line-style.html                    | 157 ++++++++++++++++++++++++++++++--
 3 files changed, 153 insertions(+), 10 deletions(-)

diff --git a/src/component/axisPointer/viewHelper.ts b/src/component/axisPointer/viewHelper.ts
index d379c1a..47abec0 100644
--- a/src/component/axisPointer/viewHelper.ts
+++ b/src/component/axisPointer/viewHelper.ts
@@ -121,7 +121,7 @@ export function buildLabelElOption(
         // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
         x: position[0],
         y: position[1],
-        // TODO: rich
+        // TODO: rich & borderType
         style: {
             text: text,
             textFont: font,
diff --git a/src/component/title.ts b/src/component/title.ts
index 9b41939..13a1306 100644
--- a/src/component/title.ts
+++ b/src/component/title.ts
@@ -187,7 +187,7 @@ class TitleView extends ComponentView {
         }
         if (sublink) {
             subTextEl.on('click', function () {
-                windowOpen(link, '_' + titleModel.get('subtarget'));
+                windowOpen(sublink, '_' + titleModel.get('subtarget'));
             });
         }
 
@@ -277,4 +277,4 @@ class TitleView extends ComponentView {
     }
 }
 
-ComponentView.registerClass(TitleView);
\ No newline at end of file
+ComponentView.registerClass(TitleView);
diff --git a/test/line-style.html b/test/line-style.html
index 22a3bd0..6443cb6 100644
--- a/test/line-style.html
+++ b/test/line-style.html
@@ -138,19 +138,162 @@ under the License.
             'echarts'
         ], function (echarts) {
             var option = {
+                title: {
+                    text: '这是标题~',
+                    borderColor: 'red',
+                    borderWidth: 1,
+                    borderType: 'dashed',
+                    textStyle: {
+                        textBorderWidth: 1,
+                        textBorderColor: 'red',
+                        textBorderType: 'dotted'
+                    },
+                    subtext: '这是副标题',
+                    subtextStyle: {
+                        textBorderWidth: 1,
+                        textBorderColor: 'cyan',
+                        textBorderType: 'dashed',
+                        textBorderDash: [15, 3, 3]
+                    }
+                },
                 legend: {
-                    left: 'center',
-                    bottom: 'bottom'
+                    left: '10%',
+                    bottom: '2%',
+                    right: '10%',
+                    borderWidth: 1,
+                    borderColor: 'blue',
+                    borderType: 'dotted',
+                    textStyle: {
+                        textBorderWidth: 1,
+                        textBorderColor: 'green',
+                        textBorderType: 'dotted'
+                    }
+                },
+                toolbox: {
+                    show: true,
+                    feature: {
+                      dataZoom: {
+                        yAxisIndex: "none"
+                      },
+                      dataView: {
+                        readOnly: false
+                      },
+                      magicType: {
+                        type: ["line", "bar"]
+                      },
+                      restore: {},
+                      saveAsImage: {}
+                    },
+                    iconStyle: {
+                        borderType: 'dotted',
+                        borderWidth: 1,
+                        borderColor: 'cyan'
+                    }
+                },
+                axisPointer: {
+                    show: true,
+                    type: 'line',
+                    lineStyle: {
+                        type: 'dotted',
+                        color: 'cyan',
+                        width: 2
+                    },
+                    // TODO
+                    // label: {
+                    //     borderWidth: 1,
+                    //     borderColor: 'blue',
+                    //     borderType: 'dashed',
+                    //     backgroundColor: 'transparent'
+                    // }
                 },
                 xAxis: {
                     type: 'category',
                     data: [100, 200, 20, 30, 60, 89],
+                    name: 'X轴',
+                    nameTextStyle: {
+                        borderWidth: 1,
+                        borderColor: 'red',
+                        borderType: 'dashed',
+                        textBorderWidth: 1,
+                        textBorderColor: 'green',
+                        //textBorderType: 'dashed'
+                    },
+                    splitLine: {
+                        show: true,
+                        lineStyle: {
+                            width: 2,
+                            type: 'dotted'
+                        }
+                    }
                 },
                 yAxis: {
                     type: 'value',
+                    name: 'Y轴',
+                    nameTextStyle: {
+                        borderWidth: 1,
+                        borderColor: 'black'
+                    },
+                    splitLine: {
+                        lineStyle: {
+                            type: 'dashed',
+                            dashArray: [20, 5, 5]
+                        }
+                    }
+                },
+                graphic: {
+                    elements: [{
+                        type: 'group',
+                        left: '10%',
+                        top: 'center',
+                        children: [
+                            {
+                                type: 'rect',
+                                z: 100,
+                                left: 'center',
+                                top: 'middle',
+                                shape: {
+                                    width: 190,
+                                    height: 90
+                                },
+                                style: {
+                                    fill: '#fff',
+                                    stroke: '#555',
+                                    lineWidth: 2,
+                                    lineDash: [5, 5],
+                                    shadowBlur: 8,
+                                    shadowOffsetX: 3,
+                                    shadowOffsetY: 3,
+                                    shadowColor: 'rgba(0,0,0,0.3)'
+                                }
+                            },
+                            {
+                                type: 'text',
+                                z: 100,
+                                left: 'center',
+                                top: 'middle',
+                                style: {
+                                    fill: '#333',
+                                    text: [
+                                        '横轴表示温度,单位是°C',
+                                        '纵轴表示高度,单位是km',
+                                        '右上角有一个图片做的水印',
+                                        '这个文本块可以放在图中各',
+                                        '种位置'
+                                    ].join('\n'),
+                                    stroke: 'red',
+                                    lineDash: [2],
+                                    lineWidth: 1,
+                                    borderWidth: 2,
+                                    borderColor: 'blue',
+                                    borderDash: [5, 5],
+                                    font: '14px Microsoft YaHei'
+                                }
+                            }
+                        ]
+                    }]
                 },
                 grid: {
-                    bottom: 120
+                    bottom: 180
                 },
                 series: [
                     {
@@ -321,10 +464,10 @@ under the License.
                 option: option
             });
 
-            setTimeout(function() {
-                option.series[0].symbol = 'emptyCircle';
-                chart2.setOption(option);
-            }, 2000);
+            // setTimeout(function() {
+            //     option.series[0].symbol = 'emptyCircle';
+            //     chart2.setOption(option);
+            // }, 2000);
         });
     </script>
 </body>


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