From 0163f9ebbf511c809573c4f567a4e67750a99e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Wiedemann?= Date: Sat, 20 Mar 2021 15:38:05 +0000 Subject: [PATCH] fix(group_by): When group_by was used with lines, the end of the chart was showing an empty slot (display bug only) --- src/apexcharts-card.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apexcharts-card.ts b/src/apexcharts-card.ts index 7f441e8..fc859ab 100644 --- a/src/apexcharts-card.ts +++ b/src/apexcharts-card.ts @@ -1029,10 +1029,10 @@ class ChartsCard extends LitElement { const localEnd = new Date(end); let offsetEnd: number | undefined = 0; const series = brush ? this._config?.series_in_brush : this._config?.series_in_graph; - const onlyBars = series?.reduce((acc, serie) => { - return acc && serie.type === 'column' && serie.group_by.func !== 'raw'; + const onlyGroupBy = series?.reduce((acc, serie) => { + return acc && serie.group_by.func !== 'raw'; }, series?.length > 0); - if (onlyBars) { + if (onlyGroupBy) { offsetEnd = series?.reduce((acc, serie) => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const dur = parse(serie.group_by.duration)!;