提交 a654399b 编写于 作者: O Ovilia

test(legend): update test cases

上级 36462969
......@@ -35,17 +35,20 @@ under the License.
<div id="main1"></div>
<div id="main2"></div>
<script>
require(['echarts'], function (echarts) {
var getData = function (seriesId) {
function getData(seriesId) {
var data = [];
for (var i = 0; i < 7; ++i) {
data.push(Math.random() * 100 + (seriesId + 1) * 200);
}
return data;
};
}
</script>
<script>
require(['echarts'], function (echarts) {
var option = {
xAxis: {
type: 'category',
......@@ -54,48 +57,85 @@ under the License.
yAxis: {
type: 'value'
},
legend: {
data: ['Default Line', 'Line with emptyCircle', 'Line with emptyCircle and color', 'Line with style', 'Line with visualMap', 'Pie A', 'Pie B', 'Pie C']
},
legend: [{
data: [
'Line A',
'Line B',
{
name: 'Pie A',
itemStyle: {
// borderWidth:
}
},
'Pie B', 'Pie C',
{
name: 'Line C',
symbolSize: 'inherit'
}, 'Line F'
]
}, {
bottom: 10,
data: [{
name: 'Line D'
}, {
name: 'Line E',
itemStyle: {
color: 'yellow'
}
}],
itemStyle: {
color: 'orange'
}
}],
series: [{
data: getData(0),
type: 'line',
name: 'Default Line'
name: 'Line A'
}, {
data: getData(1),
type: 'line',
name: 'Line with emptyCircle',
symbol: 'emptyCircle'
name: 'Line B',
itemStyle: {
color: 'red',
borderWidth: 5
},
symbolSize: 10
}, {
data: getData(2),
type: 'line',
name: 'Line with emptyCircle and color',
symbol: 'emptyCircle',
name: 'Line C',
lineStyle: {
color: 'green',
width: 5,
shadowBlur: 10,
shadowColor: 'orange'
},
itemStyle: {
color: 'auto'
}
color: 'red'
},
symbolSize: 30
}, {
data: getData(3),
type: 'line',
name: 'Line with style',
symbolSize: 12,
name: 'Line D',
itemStyle: {
color: 'auto',
borderColor: 'blue',
borderWidth: 2,
symbolSize: 25
},
lineStyle: {
color: 'red',
width: 4
color: 'blue'
}
}, {
data: getData(4),
type: 'line',
name: 'Line with visualMap',
symbolSize: 30,
name: 'Line E',
itemStyle: {
color: 'green'
},
symbolSize: 10
}, {
data: getData(5),
type: 'line',
name: 'Line F',
symbolSize: 10,
itemStyle: {
borderColor: 'green'
color: 'blue'
}
}, {
type: 'pie',
......@@ -112,6 +152,10 @@ under the License.
color: 'blue'
}
}],
itemStyle: {
borderWidth: 5,
borderColor: '#fff'
},
center: ['80%', '50%']
}],
grid: {
......@@ -120,19 +164,26 @@ under the License.
},
visualMap: {
type: 'continuous',
min: 1000,
max: 1100,
min: 1200,
max: 1300,
inRange: {
color: ['green', 'yellow', 'red']
},
show: false,
seriesIndex: 4
}
seriesIndex: 5
},
animation: 0
};
var chart = testHelper.create(echarts, 'main1', {
title: [
'Legend icon being more intuitive'
'**Legend icon being more intuitive**',
'Line A: the style of the line and items should be the same in those in legend; all colored in the first theme color',
'Line B: the style of the line and items should be the same in those in legend; all colored in red',
'Line C: the style of the line and items should be the same in those in legend; items colored in red and line colored in green',
'Line D: the style of the line should be the same in that in the legend; items colored orange in legend and blue in series',
'Line E: the style of the line should be the same in that in the legend; items colored yellow in legend and green in series',
'Line F: the colors in the legend should be blue'
],
option: option
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册