NEZ-627 perf: 图表高度改为span

This commit is contained in:
chenjinsong
2021-05-17 22:31:14 +08:00
parent bb41a56007
commit 5052aeb853
9 changed files with 82 additions and 66 deletions

View File

@@ -183,7 +183,8 @@ export default {
},
extraCssText: 'z-index:1000;'
},
series: null
series: null,
stepWidth: null
}
}
},
@@ -354,6 +355,7 @@ export default {
},
initChart: function (type) {
this.option.series = this.pieData
this.stepWidth = document.getElementById('listContainer').offsetWidth / 12
if (type == 'local') {
this.initLocal()
} else {
@@ -382,12 +384,13 @@ export default {
}
this.$nextTick(() => {
const vm = this
setTimeout(function () {
const divHeight = self.$refs.legendArea.offsetHeight
if (!self.chartData.height) {
getChart(self.chartIndex).resize({ height: (400 - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
} else {
getChart(self.chartIndex).resize({ height: (self.chartData.height - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
getChart(self.chartIndex).resize({ height: (self.chartData.height * vm.stepWidth - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
}
self.$set(self.option.tooltip, 'formatter', self.formatterFunc)
self.$set(self.option.tooltip, 'position', function (point, params, dom, rect, size) {