feat: overview,有些细节未优化

This commit is contained in:
陈劲松
2020-04-23 22:27:41 +08:00
parent 65d56a8fdb
commit e8d74caa28
4 changed files with 298 additions and 35 deletions

View File

@@ -30,6 +30,7 @@
'loading':loading,
},
props:{
name: {type: String},
chartTitle:{type:String},
showToolbox:{type:Boolean,default:true},
chartType:{type:String,default:'line'},
@@ -41,7 +42,7 @@
return {
chart:null,
option:{},
chartId:new uuidv1()+'-'+new Date().getTime(),
chartId: this.name + new uuidv1()+'-'+new Date().getTime(),
legend:[],
}
},
@@ -64,9 +65,9 @@
},
setSeries:function(series){
if(!this.chart){
this.chart=echarts.init(document.getElementById(this.chartId));
this.chart = echarts.init(document.getElementById(this.chartId));
}
this.series=series;
this.series = series;
if(this.chartType == 'map'){
if(this.map){
echarts.registerMap(this.map.name,this.map.geoJson);
@@ -85,7 +86,7 @@
if (this.tooltipFormatter) {
this.modifyOption('tooltip', 'formatter', this.tooltipFormatter)
} else {
this.modifyOption('tooltip', 'formatter', this.defaultTooltipFormatter)
//this.modifyOption('tooltip', 'formatter', this.defaultTooltipFormatter)
}
if(this.chartType == 'line'){