This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit 9b67094fb5328e276d931cf58f7f01be4db471a2 Author: Ovilia <zwl.s...@gmail.com> AuthorDate: Thu Dec 12 16:24:13 2019 +0800 test(markLine): add test cases for #11569 --- test/markLine.html | 93 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 35 deletions(-) diff --git a/test/markLine.html b/test/markLine.html index e0b343d..38dde25 100644 --- a/test/markLine.html +++ b/test/markLine.html @@ -55,7 +55,61 @@ under the License. data2.push(+Math.random().toFixed(2)); } + var markLine1 = []; + var markLine2 = []; + var positions = [ + 'start', 'middle', 'end', + 'insideStart', 'insideStartTop', 'insideStartBottom', + 'insideMiddle', 'insideMiddleTop', 'insideMiddleBottom', + 'insideEnd', 'insideEndTop', 'insideEndBottom' + ]; + for (var i = 0; i < positions.length; ++i) { + markLine1.push({ + name: positions[i], + yAxis: 1.8 - 0.2 * Math.floor(i / 3), + label: { + formatter: '{b}', + position: positions[i] + } + }); + markLine1.push([{ + name: 'start: ' + positions[i], + type: 'min', + label: { + formatter: positions[i], + position: positions[i] + } + }, { + name: 'end: ' + positions[i], + type: 'max' + }]); + + markLine2.push({ + name: positions[i], + xAxis: Math.floor(i / 3), + label: { + formatter: '{b}', + position: positions[i] + } + }); + markLine2.push([{ + name: 'start: ' + positions[i], + type: 'min', + valueIndex: 0, + label: { + formatter: positions[i], + position: positions[i] + } + }, { + name: 'end: ' + positions[i], + valueIndex: 0, + type: 'max' + }]); + } + chart.setOption({ + animation: false, + color: ['#f60', '#0c6'], legend: { data: ['line', 'line2'] }, @@ -77,7 +131,8 @@ under the License. yAxis: { splitLine: { // show: false - } + }, + max: 2 }, series: [{ name: 'line', @@ -87,26 +142,7 @@ under the License. data: data1, markLine: { - data: [{ - name: '平均值', - type: 'average', - valueIndex: 1 - }, { - name: '指定值', - yAxis: 1 - }, [{ - name: '标签位置为中间', - type: 'min', - label: { - normal: { - formatter: '{b}', - position: 'middle' - } - } - }, { - name: '标签位置为中间', - type: 'max' - }]] + data: markLine1 } }, { name: 'line2', @@ -116,20 +152,7 @@ under the License. data: data2, markLine: { - data: [{ - name: '平均值', - type: 'average', - valueIndex: 0 - }, { - name: '指定值', - xAxis: 3 - }, [{ - name: '最大点', - type: 'max' - }, { - x: '90%', - yAxis: 'max' - }]] + data: markLine2 } }] }); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org