Tweak legend expand/collapse button (#24484)

* Tweak legend expand/collapse button

* Revert "Tweak legend expand/collapse button"

This reverts commit 5eafdad781c8d9fb9800ae433cc622001c46338d.

* update UX
This commit is contained in:
Petar Petrov 2025-03-04 15:51:54 +02:00 committed by GitHub
parent 7a56731f56
commit e5b460c259
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -252,9 +252,11 @@ export class HaChartBase extends LitElement {
<ha-assist-chip
@click=${this._toggleExpandedLegend}
filled
label=${`${this.hass.localize(
`ui.components.history_charts.${this.expandLegend ? "collapse_legend" : "expand_legend"}`
)} (${items.length})`}
label=${this.expandLegend
? this.hass.localize(
"ui.components.history_charts.collapse_legend"
)
: `${this.hass.localize("ui.components.history_charts.expand_legend")} (${items.length - overflowLimit})`}
>
<ha-svg-icon
slot="trailing-icon"