Closed SanjaLV closed 5 years ago
index 358b678..d667b6e 100644 --- a/core/views.py +++ b/core/views.py @@ -93,7 +93,8 @@ def player_data(request, player_id): last_games.reverse() graph_data = [] - graph_data.append(GraphData(all_games[0].pk - 1, 800)) + if len(all_games) > 0: + graph_data.append(GraphData(all_games[0].pk - 1, 800)) for g in all_games: if g.player1 == this_player: diff --git a/templates/core/base.html b/templates/core/base.html index 9bfd936..c0443f2 100644 --- a/templates/core/base.html +++ b/templates/core/base.html @@ -53,8 +53,9 @@ </ul> {% endif %} +<br> <div class="d-flex justify-content-center"> - <div class="w-50"> + <div style="min-width: 50%;"> {% block main %} {% endblock %} </div> diff --git a/templates/core/graphs.html b/templates/core/graphs.html index 4eab1ca..59dd613 100644 --- a/templates/core/graphs.html +++ b/templates/core/graphs.html @@ -20,7 +20,7 @@ {% endblock %} {% block main %} - + <div class="input-group inline" id="player_selector"> </div> <br> @@ -43,6 +43,6 @@ {% block full_size %} {% if graph_data %} - <div id="chart_div"></div> + <div id="chart_div" style="height:1000px;"></div> {% endif %} {% endblock %} diff --git a/templates/core/player.html b/templates/core/player.html index 2125998..6ef6960 100644 --- a/templates/core/player.html +++ b/templates/core/player.html @@ -65,6 +65,6 @@ {% block full_size %} {% if graph_data %} - <div id="chart_div"></div> + <div id="chart_div" style="height:500px;"></div> {% endif %} {% endblock %}