diff --git a/nezha-fronted/src/assets/css/components/chart/chart.scss b/nezha-fronted/src/assets/css/components/chart/chart.scss index 87923dc71..67cd268db 100644 --- a/nezha-fronted/src/assets/css/components/chart/chart.scss +++ b/nezha-fronted/src/assets/css/components/chart/chart.scss @@ -413,6 +413,8 @@ display: flex; .nz-chart{ padding: 0 20px 30px 20px; + box-sizing: border-box; + height: calc(100% - 55px); } } } diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index 2d65418f6..b4861b05f 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -132,6 +132,7 @@ import otherChartConfig from '@/components/common/rightBox/chart/otherChartConfi import systemChartConfig from '@/components/common/rightBox/chart/systemChartConfig' import panelChart from '@/components/chart/panelChart' import lodash from 'lodash' +import bus from '@/libs/bus' const rz = { methods: { @@ -403,7 +404,9 @@ export default { }, preview (show) { if (show) { - this.timeRange = [new Date().setHours(new Date().getHours() - 1), new Date()] + const start = new Date().setHours(new Date().getHours() - 1) + const end = new Date() + this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)] this.prevChart = lodash.cloneDeep(this.editChart) this.prevChart.loaded = true this.prevChart.param.showHeader = true