feat: overview(部分)

This commit is contained in:
chenjinsong
2020-08-27 21:40:39 +08:00
parent 5851ed7067
commit 32f1eb703e
11 changed files with 305 additions and 194 deletions

View File

@@ -71,7 +71,7 @@
this.legend=legend.filter((item,index)=>index<this.dataSize);
this.resize();
},
setSeries:function(series){
setSeries:function(series, legend, legendData){
if(!this.chart){
this.chart = echarts.init(document.getElementById(this.chartId));
}
@@ -86,7 +86,16 @@
}
if(!this.option){
this.option=chartConfig.getOption(this.chartType);
this.option = chartConfig.getOption(this.chartType);
}
if (legend && legendData) {
legend.formatter = function(name) {
let type = legendData.find(item => {
return item[0] == name;
});
return `${name} (${type[1]}%)`;
}
this.$set(this.option, "legend", legend);
}
if(this.chartType == 'map'){