echart折线图插件图片的宽度和页面的自适应
2018-10-12 10:27 马尔代夫_珍 阅读(1606) 评论(0) 编辑 收藏 举报 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