diff --git a/nezha-fronted/src/components/chart/chart/chartBar.vue b/nezha-fronted/src/components/chart/chart/chartBar.vue index 339b9c46a..a545eca3e 100644 --- a/nezha-fronted/src/components/chart/chart/chartBar.vue +++ b/nezha-fronted/src/components/chart/chart/chartBar.vue @@ -127,7 +127,8 @@ export default { value: value, realValue: value, showValue: showValue, - name: this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex), + name: this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).name, + alias: this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).alias, labels: data.metric, seriesIndex: expressionIndex, dataIndex: dataIndex, diff --git a/nezha-fronted/src/components/chart/chart/chartGauge.vue b/nezha-fronted/src/components/chart/chart/chartGauge.vue index 671741f1a..64c805e82 100644 --- a/nezha-fronted/src/components/chart/chart/chartGauge.vue +++ b/nezha-fronted/src/components/chart/chart/chartGauge.vue @@ -88,8 +88,9 @@ export default { gauge.max = getMetricTypeValue(data.values, 'max') gauge.min = getMetricTypeValue(data.values, 'min') gauge.label = data.metric - gauge.legend = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex) - gauge.name = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex) + gauge.legend = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).alias + gauge.name = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).name + gauge.alias = this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).alias gauge.showValue = chartDataFormat.getUnit(chartInfo.unit ? chartInfo.unit : 2).compute(gauge.value, null, -1, 2) // gauge.value = gauge.showValue gauge.mapping = this.selectMapping(gauge.value, chartInfo.param.valueMapping, chartInfo.param.enable && this.chartInfo.param.enable.valueMapping) diff --git a/nezha-fronted/src/components/chart/chart/chartPie.vue b/nezha-fronted/src/components/chart/chart/chartPie.vue index ab21fd9a7..b1ff4c961 100644 --- a/nezha-fronted/src/components/chart/chart/chartPie.vue +++ b/nezha-fronted/src/components/chart/chart/chartPie.vue @@ -110,7 +110,8 @@ export default { value: value, realValue: value, showValue: showValue, - name: this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex), + name: this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).name, + alias: this.handleLegend(chartInfo, data, expressionIndex, dataIndex, colorIndex).alias, labels: data.metric, seriesIndex: expressionIndex, dataIndex: dataIndex, @@ -132,7 +133,7 @@ export default { const self = this return `