mirror of
https://github.com/kalkih/mini-graph-card.git
synced 2025-12-20 00:35:56 +01:00
fix: hide graph loading indicator when appropriate (#1197)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -323,8 +323,11 @@ class MiniGraphCard extends LitElement {
|
||||
}
|
||||
|
||||
renderGraph() {
|
||||
const ready = this.entity[0] && this.Graph[0]._history !== undefined;
|
||||
|
||||
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`
|
||||
|
||||
Reference in New Issue
Block a user