Skip to content

Commit

Permalink
Fix extraction of chart data
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Nov 20, 2024
1 parent 23cc9b6 commit 4153803
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion digiplan/map/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4153803

Please sign in to comment.