File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -323,16 +323,22 @@ class MiniGraphCard extends LitElement {
323323 }
324324
325325 renderGraph ( ) {
326+ const ready = this . entity [ 0 ] && this . Graph [ 0 ] . _history !== undefined ;
327+
326328 return this . config . show . graph ? html `
327329 < div class ="graph ">
328- < div class ="graph__container ">
329- ${ this . renderLabels ( ) }
330- ${ this . renderLabelsSecondary ( ) }
331- < div class ="graph__container__svg ">
332- ${ this . renderSvg ( ) }
333- </ div >
334- </ div >
335- ${ this . renderLegend ( ) }
330+ ${ ready ? html `
331+ < div class ="graph__container ">
332+ ${ this . renderLabels ( ) }
333+ ${ this . renderLabelsSecondary ( ) }
334+ < div class ="graph__container__svg ">
335+ ${ this . renderSvg ( ) }
336+ </ div >
337+ </ div >
338+ ${ this . renderLegend ( ) }
339+ ` : html `
340+ < ha-circular-progress indeterminate > </ ha-circular-progress >
341+ ` }
336342 </ div > ` : '' ;
337343 }
338344
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ const style = css`
6767 ha-card [hover ] {
6868 cursor : pointer;
6969 }
70+ ha-circular-progress {
71+ margin : auto;
72+ }
7073 .flex {
7174 display : flex;
7275 display : -webkit-flex;
You can’t perform that action at this time.
0 commit comments