From bada8f0b916d4f1ef35c902556e19d442addb16c Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Wed, 27 Apr 2022 18:50:56 -0400 Subject: [PATCH 1/2] Update apexcharts-card.ts Fix for stacked graphs with auto yaxis heights being limited in height to the max value --- src/apexcharts-card.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/apexcharts-card.ts b/src/apexcharts-card.ts index 9804a4f..c16096d 100644 --- a/src/apexcharts-card.ts +++ b/src/apexcharts-card.ts @@ -1187,8 +1187,12 @@ class ChartsCard extends LitElement { } if (max === undefined || max === null) { max = elt.max[1]; - } else if (elt.max[1] !== null && max < elt.max[1]) { - max = elt.max[1]; + } else if (elt.max[1] !== null) { + if (this._config.stacked) { + max = max + elt.max[1]; + } else if (max < elt.max[1]) { + max = elt.max[1]; + } } }); if (yaxis.align_to !== undefined) { From a16fa7ab66d63fa030a6174b33816c5c10147f3d Mon Sep 17 00:00:00 2001 From: Laccolith Date: Thu, 28 Apr 2022 10:08:40 -0400 Subject: [PATCH 2/2] Addressing an error --- src/apexcharts-card.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apexcharts-card.ts b/src/apexcharts-card.ts index c16096d..23f6ef1 100644 --- a/src/apexcharts-card.ts +++ b/src/apexcharts-card.ts @@ -1188,8 +1188,8 @@ class ChartsCard extends LitElement { if (max === undefined || max === null) { max = elt.max[1]; } else if (elt.max[1] !== null) { - if (this._config.stacked) { - max = max + elt.max[1]; + if (this._config?.stacked) { + max += elt.max[1]; } else if (max < elt.max[1]) { max = elt.max[1]; }