Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix waffle plots #469

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions project/npda/views/dashboard/partials.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def get_waffle_chart_partial(request):

chart_data = []
# For each label, add the appropriate number of squares to the chart data
for idx, (label, num_squares) in enumerate(data):
for idx, (label, num_squares) in enumerate(data.items()):
# For each square, append its data as current r,c, and colour
for _ in range(num_squares):
square_data = {
Expand Down Expand Up @@ -216,7 +216,7 @@ def get_waffle_chart_partial(request):
)

# Add legend
for idx, (label, pct) in enumerate(data):
for idx, (label, pct) in enumerate(data.items()):
fig.add_trace(
go.Scatter(
x=[None],
Expand Down
Loading