利用Echarts中的动画属性animation;并使用animationDuration控制动画时间;
const optionFree = {
xAxis: {
data: this.xData
},
yAxis: {
name: "人口(万)",
min: "120000",
max: "150000"
},
animation: true,
animationDuration: 20000,
series: [
{
data: this.populationData,
type: "line",
smooth: true,
endLabel: {
show: true
}
}
]
};