Skip to content

Commit

Permalink
tooltip with name on mouse over
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze committed May 9, 2022
1 parent 409d40e commit 88a8ba3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ha-sankey-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,18 @@ export class SankeyChart extends LitElement {
}
${boxes.map((box, i) => {
const formattedState = parseFloat(box.state.toFixed(this.config.round));
const name = box.config.name || box.entity.attributes.friendly_name || '';
return html`
${i > 0 ? html`<div class="spacerv" style=${styleMap({height: section.spacerH+'px'})}></div>` : null}
<div class="box" style=${styleMap({height: box.size+'px'})}>
<div style=${styleMap({backgroundColor: box.color})} @click=${() => this._handleBoxClick(box)}>
<div style=${styleMap({backgroundColor: box.color})}
@click=${() => this._handleBoxClick(box)}
title=${name}
>
${show_icons && html`<ha-icon .icon=${stateIcon(box.entity)}></ha-icon>`}
</div>
<div class="label">${formattedState}${box.unit_of_measurement}
${show_names && html`<span>${box.config.name || box.entity.attributes.friendly_name}</span>`}
${show_names && html`<span>${name}</span>`}
</div>
</div>
`;
Expand Down

0 comments on commit 88a8ba3

Please sign in to comment.