option = { dataZoom: { type: 'slider', show: true, xAxisIndex: [0], start: 1, end: 35 }, xAxis: [{ type: 'category', boundaryGap: true, data: [1, 2, 3, 4, 5, 6, 7, 8] }, { type: 'category', boundaryGap: true, data: (function() { var res = []; var len = 10; while (len--) { res.push(10 - len - 1); } return res; })() } ], yAxis: [{ type: 'value', scale: true, name: '价格', max: 30, min: 0, boundaryGap: [0.2, 0.2] }, { type: 'value', scale: true, name: '预购量', max: 50, min: 0, boundaryGap: [0.2, 0.2] } ], series: [{ name: '预购队列', type: 'bar', xAxisIndex: 1, yAxisIndex: 1, data: [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 81, 2, 3, 4, 5, 6, 7, 8] }, { name: '最新成交价', type: 'line', data: [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 81, 2, 3, 4, 5, 6, 7, 81, 2, 3, 4, 5, 6, 7, 8] } ] }; setInterval(function() { var abc = []; var bcd = []; option.series[0].data = abc, option.series[1].data = bcd, abc.push(10); bcd.push(3); myChart.clear(); myChart.setOption(option, true); }, 5000);