在网上搜索了一些图表缩放方法:
1. window.onresize = myChart.resize;
但此方法只适合单页面,也就是说一个页面里有两个图表是只有一个起作用,于是乎,
有了如下方法:
2. window.addEventListener("resize",function(){
myChart.resize(); //myChart指自己定义的echartsDom对象
});
自适应
顺便记录一下这次图表的一些常见样式问题:
1. 折线图
xAxis: {
type: 'category',
data: this.xData,
boundaryGap: false,
splitLine: {
show: true
},
axisLabel: {
interval: 3, // x轴的刻度每隔三个一显示
rotate: 60 // x轴的刻度字样倾斜60度
}
},
grid: {
x: 40,
x2: 20,
y2: 100
},
yAxis: {
type: 'value'
},
series: [{
data: this.seriesData,
type: