diff --git a/nezha-fronted/src/components/chart/chart/chartGroup.vue b/nezha-fronted/src/components/chart/chart/chartGroup.vue index d7c6980e1..922ffa0dd 100644 --- a/nezha-fronted/src/components/chart/chart/chartGroup.vue +++ b/nezha-fronted/src/components/chart/chart/chartGroup.vue @@ -10,6 +10,7 @@ :panel-lock="panelLock" :isGroup="true" :time-range="searchTime" + :groupInfo="chartInfo" @on-refresh-time="refreshTime" :loading="chartListLoading" > @@ -23,7 +24,7 @@ import chartFormat from '@/components/chart/chartFormat' export default { name: 'chart-group', props: { - panelLock: Boolean + panelLock: Boolean, }, mixins: [chartMixin, chartFormat], computed: { diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index 229871576..80cba2f29 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -244,6 +244,9 @@ export default { option.tooltip[0].formatter = self.tooltipFormatter(self.isStack) myChart.setOption(option) } + }, + resize () { + getChart(this.chartId).resize() } }, mounted () { diff --git a/nezha-fronted/src/components/chart/chart/options/chartTreemap.js b/nezha-fronted/src/components/chart/chart/options/chartTreemap.js index 55e8eec04..ef10ffeea 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartTreemap.js +++ b/nezha-fronted/src/components/chart/chart/options/chartTreemap.js @@ -22,6 +22,7 @@ const chartTreemapOption = { type: 'treemap', visibleMin: 40, childrenVisibleMin: 40, + nodeClick: false, label: { show: true, position: 'inside', diff --git a/nezha-fronted/src/components/chart/chart/tools.js b/nezha-fronted/src/components/chart/chart/tools.js index 803dad732..567fb4214 100644 --- a/nezha-fronted/src/components/chart/chart/tools.js +++ b/nezha-fronted/src/components/chart/chart/tools.js @@ -83,6 +83,30 @@ export function isGroup (type) { return type === chartType.group } +export function getGroupHeight (arr) { + if (arr.length) { + let lastItem = [] + let maxY = 0 + arr.forEach((children, index) => { + if (maxY == children.y) { + lastItem.push(children) + } else { + maxY = children.y + lastItem = [children] + } + }) + let maxHeight = 0 + lastItem.forEach(last => { + if (maxHeight < last.height) { + maxHeight = last.height + } + }) + return maxHeight + maxY + } else { + return 1 + } +} + export function initColor (colorNum = 20) { const colorList = [ '#FF5200', '#3685FF', '#FF8D00', '#00DCA2', diff --git a/nezha-fronted/src/components/chart/chartHeader.vue b/nezha-fronted/src/components/chart/chartHeader.vue index fc85f7ee9..8e5cde1de 100644 --- a/nezha-fronted/src/components/chart/chartHeader.vue +++ b/nezha-fronted/src/components/chart/chartHeader.vue @@ -1,6 +1,7 @@