Skip to content

Commit

Permalink
Feature Request: Card title #5
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze committed May 19, 2022
1 parent 8dbffd4 commit 56e5d00
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ A Home Assistant lovelace card to display a sankey chart. For example for power
| ----------------- | ------- | ------------ | ------------------- | ------------------------------------------- |
| type | string | **Required** | | `custom:sankey-chart`
| sections | list | **Required** | | Entities to show divided by sections, see [sections object](#sections-object) for additional options.
| title | string | **Optional** | | Optional header title for the card
| unit_prefix | string | **Optional** | | Metric prefix for the unit of measurment. See <https://en.wikipedia.org/wiki/Unit_prefix> . Supported values are m, k, M, G, T
| round | number | **Optional** | 0 | Round the value to at most N decimal places.
| height | number | **Optional** | 200 | The height of the card in pixels
Expand Down
1 change: 1 addition & 0 deletions src/ha-sankey-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class SankeyChart extends LitElement {
<ha-card
tabindex="0"
label="Sankey Chart"
.header=${this.config.title}
>
<div class="container ${this.config.wide ? 'wide' : ''}" style=${styleMap({height: this.height+'px'})}>
${this.sections.map((s, i) => this.renderSection(i))}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface SectionConfig {

export interface SankeyChartConfig extends LovelaceCardConfig {
type: string;
title?: string;
sections: SectionConfig[];
unit_prefix?: '' | keyof typeof UNIT_PREFIXES;
round?: number;
Expand Down

0 comments on commit 56e5d00

Please sign in to comment.