From 41538037f8dae40aead48778e9baf85ffde18b33 Mon Sep 17 00:00:00 2001 From: Hendrik Huyskens Date: Wed, 20 Nov 2024 08:48:23 +0100 Subject: [PATCH] Fix extraction of chart data --- digiplan/map/charts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/digiplan/map/charts.py b/digiplan/map/charts.py index 1c348e85..e615118e 100644 --- a/digiplan/map/charts.py +++ b/digiplan/map/charts.py @@ -50,7 +50,11 @@ def render(self) -> dict: self.chart_options["series"][0]["data"] = data elif series_length > 1: for i in range(0, series_length): - values = self.chart_data.iloc[i] + values = ( + self.chart_data.iloc[i] + if isinstance(self.chart_data, (pd.DataFrame, pd.Series)) + else self.chart_data[i] + ) if not isinstance(values, (list, tuple)): values = [values] self.chart_options["series"][i]["data"] = values