perf:图表阈值label计算方式优化

This commit is contained in:
wangwenrui
2020-05-28 18:53:41 +08:00
parent 764eb82bd7
commit 371d6e4a20
2 changed files with 10 additions and 9 deletions

View File

@@ -1135,10 +1135,15 @@ export default {
} }
} }
}, },
computeDistance:function(value){ computeDistance:function(str){
let temp=value+''; var width = 0;
let length=temp.length *12 -20; var html = document.createElement('span');
return Number('-'+length) html.innerText = str;
html.className = 'getTextWidth';
document.querySelector('body').appendChild(html);
width = document.querySelector('.getTextWidth').offsetWidth;
document.querySelector('.getTextWidth').remove();
return Number('-'+width);
}, },
modelStaticData(chartInfo, filterType) { modelStaticData(chartInfo, filterType) {
let series = []; let series = [];

View File

@@ -202,9 +202,5 @@
} }
} }
</script> </script>
<style >
<style>
.config-dropdown{
width: unset !important;
}
</style> </style>