From 7b512fbe12ff14bd38c6abfda7cf83ead61de5b8 Mon Sep 17 00:00:00 2001 From: Thomas LEMAISTRE <35010958+Terdious@users.noreply.github.com> Date: Wed, 9 Oct 2024 02:41:55 +0200 Subject: [PATCH] Fix: Use custom feature name in non-binary charts (#2126) --- front/src/components/boxs/chart/Chart.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/front/src/components/boxs/chart/Chart.jsx b/front/src/components/boxs/chart/Chart.jsx index c97d35cf4d..98e9991bac 100644 --- a/front/src/components/boxs/chart/Chart.jsx +++ b/front/src/components/boxs/chart/Chart.jsx @@ -192,9 +192,11 @@ class Chartbox extends Component { series = data.map((oneFeature, index) => { const oneUnit = this.props.box.units ? this.props.box.units[index] : this.props.box.unit; const oneUnitTranslated = oneUnit ? this.props.intl.dictionary.deviceFeatureUnitShort[oneUnit] : null; - const { values, deviceFeature } = oneFeature; - const deviceName = deviceFeature.name; - const name = oneUnitTranslated ? `${deviceName} (${oneUnitTranslated})` : deviceName; + const { values, deviceFeature, device } = oneFeature; + const deviceFeatureName = deviceFeatureNames + ? deviceFeatureNames[index] + : getDeviceName(device, deviceFeature); + const name = oneUnitTranslated ? `${deviceFeatureName} (${oneUnitTranslated})` : deviceFeatureName; return { name, data: values.map(value => {