Echarts dynamic diagram keeps reporting errors. I don't know why.

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png


your option is not used at all, that is, you have never set xAxis and yAxis information to line_chart . Every time you setOption , you only set series information, so you will report an error.

so, you need to set the configuration item of option once at first:

var option = {
    ....
    series: [{
        data: data.slice(data.length - 7), // 
        type: 'line'
    }]
}
line_chart.setOption(option)
setInterval(function () {
    ...
}, 500);
Menu