创建echart给X轴动态赋值

给echart的X轴和Y轴赋值:

注意:标明xAxis和series的索引

var option = myChart.getOption();
                console.log(months);
                option.xAxis[0].data =months;
                option.series[0].data = drivingFootage;
                option.series[1].data = reclaimFootage;
                option.series[2].data = maintenanceFootage;
                myChart.setOption(option,true);

 

你可能感兴趣的:(Java,echarts)