Refactor inventory chart data representation; change dataset type from bar to pie and update corresponding keys for improved visualization
This commit is contained in:
parent
ec08dd8ef1
commit
89cee64f04
1 changed files with 4 additions and 4 deletions
|
@ -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'
|
||||
}]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue