Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -87,9 +87,9 @@ if allergens:
|
|
87 |
# Create pie charts for each nutritional metric in 3x2 grid
|
88 |
# If they are multi selections, each product will contribute proportion in the pie chart
|
89 |
metrics = ['Total Energy (Kcal)', 'Carbohydrate (g)', 'Protein (g)', 'Total Fat (g)', 'Sodium (g)', 'Sugar (g)']
|
90 |
-
for i in range(0, len(metrics),
|
91 |
-
cols = st.columns(
|
92 |
-
for j in range(
|
93 |
if i + j < len(metrics): # Check if the current index is within the metrics array
|
94 |
with cols[j]:
|
95 |
metric = metrics[i + j]
|
|
|
87 |
# Create pie charts for each nutritional metric in 3x2 grid
|
88 |
# If they are multi selections, each product will contribute proportion in the pie chart
|
89 |
metrics = ['Total Energy (Kcal)', 'Carbohydrate (g)', 'Protein (g)', 'Total Fat (g)', 'Sodium (g)', 'Sugar (g)']
|
90 |
+
for i in range(0, len(metrics), 2):
|
91 |
+
cols = st.columns(2) # Define three columns
|
92 |
+
for j in range(2):
|
93 |
if i + j < len(metrics): # Check if the current index is within the metrics array
|
94 |
with cols[j]:
|
95 |
metric = metrics[i + j]
|