forked from github/dataease
Merge pull request #4352 from dataease/pr@dev@refactor_tree-map-scroll
refactor(视图): Echarts矩形树图支持获取焦点再滚动
This commit is contained in:
commit
b1dadbcf1e
@ -1021,6 +1021,7 @@ export const BASE_TREEMAP = {
|
||||
{
|
||||
// name: '',
|
||||
type: 'treemap',
|
||||
roam: true,
|
||||
itemStyle: {
|
||||
gapWidth: 2
|
||||
},
|
||||
|
@ -128,6 +128,7 @@ export default {
|
||||
showSuspension: true,
|
||||
currentSeriesId: null,
|
||||
haveScrollType: [
|
||||
'treemap',
|
||||
'map',
|
||||
'chart-mix',
|
||||
'bar',
|
||||
@ -198,7 +199,13 @@ export default {
|
||||
if (this.haveScrollType.includes(this.chart.type)) {
|
||||
const opt = this.myChart.getOption()
|
||||
this.adaptorOpt(opt)
|
||||
this.myChart.setOption(opt)
|
||||
if (this.chart.type === 'treemap') {
|
||||
this.myChart.dispose()
|
||||
this.myChart = null
|
||||
this.preDraw()
|
||||
} else {
|
||||
this.myChart.setOption(opt)
|
||||
}
|
||||
}
|
||||
},
|
||||
adaptorOpt(opt) {
|
||||
@ -218,6 +225,10 @@ export default {
|
||||
opt.geo.roam = this.active
|
||||
}
|
||||
}
|
||||
//矩形树图
|
||||
if (this.chart.type === 'treemap' && opt.series) {
|
||||
opt.series[0].roam = this.active
|
||||
}
|
||||
},
|
||||
changeSeriesId(param) {
|
||||
const { id, seriesId } = param
|
||||
|
Loading…
Reference in New Issue
Block a user