Skip to content

Commit

Permalink
Fix: Use custom feature name in non-binary charts (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Terdious authored Oct 9, 2024
1 parent 2b8e274 commit 7b512fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions front/src/components/boxs/chart/Chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 7b512fb

Please sign in to comment.