Skip to content

Commit e5840fb

Browse files
committed
fix: Chart not displayed properly or at all with layout-card
Fixes #121
1 parent cff8218 commit e5840fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/apexcharts-card.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,11 @@ class ChartsCard extends LitElement {
595595
if (!this._config?.series[index].show.in_chart && !this._config?.series[index].show.in_brush) {
596596
return;
597597
}
598-
if (graph.history.length === 0) return [{ data: [] }];
598+
if (graph.history.length === 0) {
599+
if (this._config?.series[index].show.in_chart) graphData.series.push({ data: [] });
600+
if (this._config?.series[index].show.in_brush) brushData.series.push({ data: [] });
601+
return;
602+
}
599603
let data: EntityCachePoints = [];
600604
if (this._config?.series[index].extend_to_end && this._config?.series[index].type !== 'column') {
601605
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

0 commit comments

Comments
 (0)