From 89cee64f043e7c41e468ae008cc2956172fc1168 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Wed, 18 Jun 2025 16:15:53 -0500 Subject: [PATCH] Refactor inventory chart data representation; change dataset type from bar to pie and update corresponding keys for improved visualization --- routes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routes.py b/routes.py index 034ceee..6bc10ee 100644 --- a/routes.py +++ b/routes.py @@ -170,12 +170,12 @@ def index(): # Convert pandas/numpy int64s to plain old Python ints pivot = pivot.astype(int) labels = list(pivot.index) - data = [int(x) for x in pivot.values] # <- This is what fixes the JSON error + data = [int(x) for x in pivot.values] datasets = [{ - 'type': 'bar', - 'x': labels, - 'y': data, + 'type': 'pie', + 'labels': labels, + 'values': data, 'name': 'Inventory Conditions' }]