VUE2.0+Element-UI+Echarts封装的组件实例

2020-06-16 05:58:16易采站长站整理

options.grid.y2 = bottomHeight;
options.grid.y = topHeight;
if(chartWidth!='810'){
options.grid["x"]=40;
}
var columnAndRow = ['startProvince','startArea']; //始发省份和地区默认X轴旋转45度
if(options.xAxis[0].data[0].match('^(d+)+(d+)')!=null||columnAndRow.indexOf(column.code)!=-1||columnAndRow.indexOf(row.code)!=-1){
options.xAxis[0].axisLabel['rotate']=45;
}else{
options.xAxis[0].axisLabel['rotate']=0;
}
return {chartHeight:chartHeight,chartWidth:chartWidth};
}

上述代码实现了 echart图数据的格式化,和对数据的自适应。修改为上述方式之后发现性能提高了不止一个数量级。

以上这篇VUE2.0+Element-UI+Echarts封装的组件实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持软件开发网。