diff --git a/nezha-fronted/src/components/chart/chart/chartGauge.vue b/nezha-fronted/src/components/chart/chart/chartGauge.vue index ac4b57dc1..5d516c721 100644 --- a/nezha-fronted/src/components/chart/chart/chartGauge.vue +++ b/nezha-fronted/src/components/chart/chart/chartGauge.vue @@ -88,6 +88,9 @@ export default { gauge.value = getMetricTypeValue(data.values, chartInfo.param.statistics || 'last') gauge.max = getMetricTypeValue(data.values, 'max') gauge.min = getMetricTypeValue(data.values, 'min') + if (gauge.min === gauge.max) { + gauge.min = gauge.max / 2 + } gauge.label = data.metric gauge.legend = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).alias gauge.name = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).name diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index 62c8299d1..86c279f97 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -508,9 +508,9 @@ > - +
diff --git a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js index c8b08d00b..ca8fb48d9 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js +++ b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js @@ -399,6 +399,17 @@ export default { this.chartConfig.param.tags = newTags this.chartConfig.param.indexs = newTags.map(item => item.text).join(',') this.change() - } + }, + enableChange (type) { + switch (type) { + case 'valueMapping': + break; + case 'legend': + break; + case '': + break; + } + this.change() + }, } }