diff --git a/src/main.js b/src/main.js index 46496c4a..a53666a1 100644 --- a/src/main.js +++ b/src/main.js @@ -323,16 +323,22 @@ class MiniGraphCard extends LitElement { } renderGraph() { + const ready = this.entity[0] && this.Graph[0]._history !== undefined; + return this.config.show.graph ? html`
-
- ${this.renderLabels()} - ${this.renderLabelsSecondary()} -
- ${this.renderSvg()} -
-
- ${this.renderLegend()} + ${ready ? html` +
+ ${this.renderLabels()} + ${this.renderLabelsSecondary()} +
+ ${this.renderSvg()} +
+
+ ${this.renderLegend()} + ` : html` + + `}
` : ''; } diff --git a/src/style.js b/src/style.js index 497c2aeb..01395872 100644 --- a/src/style.js +++ b/src/style.js @@ -67,6 +67,9 @@ const style = css` ha-card[hover] { cursor: pointer; } + ha-circular-progress { + margin: auto; + } .flex { display: flex; display: -webkit-flex;