Skip to content

Commit

Permalink
Views: Fix memory usage of SC charts
Browse files Browse the repository at this point in the history
Issue #343
  • Loading branch information
UEWBot committed Feb 11, 2025
1 parent e17e8b7 commit 9983b78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions visualiser/tournament/game_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""

import io
import matplotlib.pyplot as plt
import matplotlib.figure as figure

from django.db import transaction
from django.db.models import Count
Expand Down Expand Up @@ -244,7 +244,8 @@ def graph(request,
g = get_game_or_404(t, game_name)
with io.BytesIO() as f:
# plot the SC counts
fig, ax = plt.subplots()
fig = figure.Figure()
ax = fig.subplots()
years = g.years_played()
for power in GreatPower.objects.all():
colour = _map_to_fg(g.the_set.setpower_set.get(power=power).colour)
Expand Down

0 comments on commit 9983b78

Please sign in to comment.