fix:修改 dashboard界面,panel内的chart图表点击右上角的堆叠时,来回点击提示会从英文变成中文 的问题

This commit is contained in:
zhangyu
2020-12-07 17:57:19 +08:00
parent 36006b0ec7
commit 4f092c2bf7
2 changed files with 142 additions and 8 deletions

View File

@@ -331,6 +331,7 @@
}) })
} }
}, },
clickLegend(legendName,index){ clickLegend(legendName,index){
//点击图表某一个legend图表只显示当前点击的曲线或柱状图其它隐藏再次点击已选中的legend ,显示全部 //点击图表某一个legend图表只显示当前点击的曲线或柱状图其它隐藏再次点击已选中的legend ,显示全部
let curIsGrey=this.isGrey[index]; let curIsGrey=this.isGrey[index];
@@ -511,7 +512,7 @@
show:false, show:false,
top:'0', top:'0',
right:'18', right:'18',
showTitle:true, showTitle:false,
feature:{ feature:{
dataZoom:{ dataZoom:{
yAxisIndex:false, yAxisIndex:false,
@@ -523,14 +524,27 @@
magicType:{ magicType:{
type:['stack'], type:['stack'],
title:{ title:{
stack:self.$t('overall.toolBox.stack') stack:self.$t('overall.toolBox.stack'),
}, },
iconStyle:{ iconStyle:{
borderColor:stackIconBorderColor, borderColor:stackIconBorderColor,
}, },
emphasis:{ emphasis:{
borderColor:stackIconChooseBorderColor, borderColor:stackIconChooseBorderColor,
} },
},
},
tooltip: { // 和 option.tooltip 的配置项相同
show: true,
position:'top',
formatter: function (param) {
return param.title; // 自定义的 DOM 结构
},
backgroundColor:'rgba(255,255,255,0)',
borderColor :'rgba(255,255,255,0)',
textStyle: {
fontSize: 12,
color : '#439AC6'
}, },
} }
}, },
@@ -818,7 +832,8 @@
getChart(this.chartIndex).on('magictypechanged', function (params) { getChart(this.chartIndex).on('magictypechanged', function (params) {
self.isStackArea = !self.isStackArea; self.isStackArea = !self.isStackArea;
if(self.isStackArea){ if(self.isStackArea){
this.setOption({ console.log(123123);
getChart(self.chartIndex).setOption({
toolbox:{ toolbox:{
feature:{ feature:{
dataZoom:{ dataZoom:{
@@ -884,7 +899,33 @@
}, },
} }
}); });
} }else{
getChart(self.chartIndex).setOption({
toolbox:{
feature:{
dataZoom:{
yAxisIndex:false,
title:{
zoom:self.$t('overall.toolBox.zoom'),
back:self.$t('overall.toolBox.back'),
}
},
magicType:{
type:['stack'],
title:{
stack:self.$t('overall.toolBox.stack')
},
iconStyle:{
borderColor:'#7e7e7e',
},
emphasis:{
borderColor:stackIconChooseBorderColor,
}
},
}
},
})
}
}); });
}); });
} else if (chartSite === 'screen') { // 全屏显示 } else if (chartSite === 'screen') { // 全屏显示
@@ -1022,6 +1063,32 @@
}, },
} }
}); });
}else{
this.setOption({
toolbox:{
feature:{
dataZoom:{
yAxisIndex:false,
title:{
zoom:self.$t('overall.toolBox.zoom'),
back:self.$t('overall.toolBox.back'),
}
},
magicType:{
type:['stack'],
title:{
stack:self.$t('overall.toolBox.stack')
},
iconStyle:{
borderColor:'#7e7e7e',
},
emphasis:{
borderColor:stackIconChooseBorderColor,
}
},
}
},
})
} }
}); });
}); });

View File

@@ -472,7 +472,8 @@
toolbox:{ toolbox:{
show:false, show:false,
top:'0', top:'0',
showTitle:true, right:'18',
showTitle:false,
feature:{ feature:{
dataZoom:{ dataZoom:{
yAxisIndex:false, yAxisIndex:false,
@@ -484,14 +485,27 @@
magicType:{ magicType:{
type:['stack'], type:['stack'],
title:{ title:{
stack:self.$t('overall.toolBox.stack') stack:self.$t('overall.toolBox.stack'),
}, },
iconStyle:{ iconStyle:{
borderColor:stackIconBorderColor, borderColor:stackIconBorderColor,
}, },
emphasis:{ emphasis:{
borderColor:stackIconChooseBorderColor, borderColor:stackIconChooseBorderColor,
} },
},
},
tooltip: { // 和 option.tooltip 的配置项相同
show: true,
position:'top',
formatter: function (param) {
return param.title; // 自定义的 DOM 结构
},
backgroundColor:'rgba(255,255,255,0)',
borderColor :'rgba(255,255,255,0)',
textStyle: {
fontSize: 12,
color : '#439AC6'
}, },
} }
}, },
@@ -870,6 +884,32 @@
}, },
} }
}); });
}else{
this.setOption({
toolbox:{
feature:{
dataZoom:{
yAxisIndex:false,
title:{
zoom:self.$t('overall.toolBox.zoom'),
back:self.$t('overall.toolBox.back'),
}
},
magicType:{
type:['stack'],
title:{
stack:self.$t('overall.toolBox.stack')
},
iconStyle:{
borderColor:'#7e7e7e',
},
emphasis:{
borderColor:stackIconChooseBorderColor,
}
},
}
},
})
} }
}); });
}); });
@@ -1001,7 +1041,34 @@
}, },
} }
}); });
}else{
this.setOption({
toolbox:{
feature:{
dataZoom:{
yAxisIndex:false,
title:{
zoom:self.$t('overall.toolBox.zoom'),
back:self.$t('overall.toolBox.back'),
}
},
magicType:{
type:['stack'],
title:{
stack:self.$t('overall.toolBox.stack')
},
iconStyle:{
borderColor:'#7e7e7e',
},
emphasis:{
borderColor:stackIconChooseBorderColor,
}
},
}
},
})
} }
}); });
}); });
} }