diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts
index bbf2fcacd7..f98856cf96 100644
--- a/src/components/chart/ha-chart-base.ts
+++ b/src/components/chart/ha-chart-base.ts
@@ -226,7 +226,12 @@ export class HaChartBase extends LitElement {
const overflowLimit = isMobile
? LEGEND_OVERFLOW_LIMIT_MOBILE
: LEGEND_OVERFLOW_LIMIT;
- return html`
+ return html`
1,
+ })}
+ >
${items.map((item: string, index: number) => {
if (!this.expandLegend && index >= overflowLimit) {
@@ -262,7 +267,9 @@ export class HaChartBase extends LitElement {
? this.hass.localize(
"ui.components.history_charts.collapse_legend"
)
- : `${this.hass.localize("ui.components.history_charts.expand_legend")} (${items.length - overflowLimit})`}
+ : `${this.hass.localize(
+ "ui.components.history_charts.expand_legend"
+ )} (${items.length - overflowLimit})`}
>