diff --git a/src/elec-sankey.ts b/src/elec-sankey.ts index 56755e7..0b29b68 100644 --- a/src/elec-sankey.ts +++ b/src/elec-sankey.ts @@ -1174,6 +1174,9 @@ export class ElecSankey extends LitElement { flex-shrink: 0; justify-content: left; padding-left: 6px; + white-space: pre; + overflow: hidden; + text-overflow: ellipsis; } svg { rect { diff --git a/src/ha-elec-sankey.ts b/src/ha-elec-sankey.ts index da7ca63..b7faebd 100644 --- a/src/ha-elec-sankey.ts +++ b/src/ha-elec-sankey.ts @@ -44,31 +44,26 @@ export class HaElecSankey extends ElecSankey { class=${id ? "label label-action-clickable" : "label"} id=${_id} @click=${id ? this._handleMoreInfo : nothing} - > - ${_name || nothing} - ${icon - ? html`
` - : nothing} - ${valueB !== undefined - ? html` + >${_name || nothing} ${icon + ? html` ` + : nothing}${valueB !== undefined + ? html`
${formatNumber(valueB, this.hass.locale, { - maximumFractionDigits: 1, - })} ${this.unit}
${formatNumber(valueA, this.hass.locale, { - maximumFractionDigits: 1, - })} ${this.unit} + maximumFractionDigits: 0, + })} ${this.unit} ` - : html`${formatNumber(valueA, this.hass.locale, { - maximumFractionDigits: 1, - })} ${this.unit}`} - - `; + : html`
${formatNumber(valueA, this.hass.locale, { + maximumFractionDigits: 0, + })} ${this.unit}`}`; } private _handleMoreInfo(e: MouseEvent) {