Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: graph loading indicator #1197

Merged
merged 16 commits into from
Jan 13, 2025
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ All properties are optional.
| labels_secondary | `hover` | `true` / `false` / `hover` | Display secondary Y-axis labels.
| name_adaptive_color | `false` | `true` / `false` | Make the name color adapt with the primary entity color.
| icon_adaptive_color | `false` | `true` / `false` | Make the icon color adapt with the primary entity color.
| loading_indicator | `true` | `true` / `false` | Show loading indicator while attempting to retrieve a history.


#### Line color object
See [dynamic line color](#dynamic-line-color) for example usage.
Expand Down
7 changes: 5 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,11 @@ class MiniGraphCard extends LitElement {
}

renderGraph() {
const ready = this.entity[0] && this.Graph[0]._history !== undefined;
akloeckner marked this conversation as resolved.
Show resolved Hide resolved

const ready = (this.entity[0] && !this.Graph.some(
(element, index) => element._history === undefined
&& this.config.entities[index].show_graph !== false,
))
|| this.config.show.loading_indicator === false;
return this.config.show.graph ? html`
<div class="graph">
${ready ? html`
Expand Down
Loading