var myChart = echarts.init(document.getElementById("divechart1"));
var option = {
title: {
text: '里程量'
},
tooltip: { trigger: "axis", formatter: '{b}<br>里程量:{c}' },
xAxis: [{ type: "category", data: json.x }],
yAxis: [{ type: "value" }],
legend: {
data: ['KM']
},
series: [
{ type: "line", data: json.y }
]
};
myChart.setOption(option);
//location.reload();
window.onresize = myChart.resize;
https://blog.csdn.net/lvkelly/article/details/53745956