Refactor inventory chart data representation; change dataset type from bar to pie and update corresponding keys for improved visualization

This commit is contained in:
Yaro Kasear 2025-06-18 16:15:53 -05:00
parent ec08dd8ef1
commit 89cee64f04

View file

@ -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'
}]