Skip to content

Commit

Permalink
fix(legend): undefined was displayed for a hidden serie
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Jan 27, 2021
1 parent 69f151b commit 352c016
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/apex-layouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function getLayoutConfig(config: ChartCardConfig, hass: HomeAssistant | u
value = (value as number).toFixed(1);
}
const uom = computeUom(opts.seriesIndex, conf, undefined, hass2?.states[conf.series[opts.seriesIndex].entity]);
return [name, `<strong>${value} ${uom}</strong>`];
return [name, value === undefined ? `<strong>N/A ${uom}</strong>` : `<strong>${value} ${uom}</strong>`];
},
},
stroke: {
Expand Down

0 comments on commit 352c016

Please sign in to comment.