配置项如下
const set1 = [
['商品', '商品1', '商品2', '商品3', '商品4'],
['2019年1月1日', 120, 642, 628, 191],
['2019年1月2日', 423, 102, 170, 164],
['2019年1月3日', 464, 412, 491, 690],
['2019年1月4日', 285, 482, 393, 213],
['2019年1月5日', 484, 616, 106, 439],
['2019年1月6日', 652, 258, 277, 578],
['2019年1月7日', 268, 510, 260, 188],
['2019年1月8日', 228, 325, 406, 286],
['2019年1月9日', 318, 211, 438, 592],
['2019年1月10日', 261, 123, 277, 189],
['2019年1月11日', 633, 590, 689, 341],
['2019年1月12日', 494, 512, 141, 100],
['2019年1月13日', 292, 210, 567, 395],
['2019年1月14日', 437, 575, 314, 628],
['2019年1月15日', 661, 123, 583, 529],
['2019年1月16日', 279, 120, 602, 538],
['2019年1月17日', 558, 572, 210, 548],
['2019年1月18日', 246, 194, 685, 164],
['2019年1月19日', 389, 390, 490, 284],
['2019年1月20日', 404, 601, 372, 265]
];
option = {
// backgroundColor:'#fff',
dataset:{
source:set1
},
legend:{
top:8,
left:8
},
grid: {
top: 40,
left: 40,
right: 6,
bottom: 48,
},
xAxis: {
type:'category'
},
yAxis: {},
series: [
{type: 'line'},
{type: 'line'},
{type: 'line'},
{type: 'line'},
]
};
myChart.resize({
width: 536,
height: 320
})