Commit f3b6dd24 authored by Lukas Burgey's avatar Lukas Burgey

Reorder stats in playerstats1

parent f0b741c3
......@@ -126,7 +126,7 @@ def _elo_history():
return elo_ratings
def glicko2():
def glicko2_history():
glicko2 = Glicko2(800, 100, 0.1, 1.2)
players = Player.objects.all()
ratings = _glicko2(players=players, periods=_get_rating_periods(), glicko2=glicko2)
......
......@@ -8,14 +8,22 @@
<div class="col-md-12">
<h5 style="margin: 0px;">{{ title }}</h5>
</div>
<div class="col-md-6">
</div>
<div class="row">
<div class="col-md-4">
<h5>{{ stat_descriptions|ldescr:'point_history' }}</h5>
<canvas id="chartpoint_history" height="170"></canvas>
<canvas id="chartpoint_history" height="250"></canvas>
</div>
<div class="col-md-6">
<div class="col-md-4">
<h5>{{ stat_descriptions|ldescr:'elo_history' }}</h5>
<canvas id="chart_elo_history" height="170"></canvas>
<canvas id="chart_elo_history" height="250"></canvas>
</div>
<div class="col-md-4">
<h5>{{ stat_descriptions|ldescr:'glicko2_history' }}</h5>
<canvas id="chart_glicko2_history" height="250"></canvas>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<h5>Player ranking</h5>
......@@ -68,6 +76,8 @@
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h5>Game endings: {{ win_percentage|floatformat:-2 }}% won</h5>
<div class="limitgrowth">
......@@ -134,10 +144,24 @@ var dataSetsEloHistory = [
},{% endfor %}
];
var dataSetsGlicko2History = [
{% for player in player_list|dictsort:"stats.points" %}{
label: "{{ player.name }}",
backgroundColor: "{{ player.color }}",
borderColor: "{{ player.color }}",
borderWidth: 3,
lineTension: 0,
pointRadius: 0.7,
fill: false,
data: [{% for elo in player.stats.glicko2_history %}{x:{{ forloop.counter0 }},y:{{ elo }},},{% endfor %}]
},{% endfor %}
];
// draw all charts, when the page is loaded
$(window).on("load", function () {
scatterChart("#chartpoint_history", dataSetsPointHistory);
scatterChart("#chart_elo_history", dataSetsEloHistory);
scatterChart("#chart_glicko2_history", dataSetsGlicko2History);
var pattern = {}
var ctx = $("#chart0")[0].getContext("2d");
pattern['Schelle'] = ctx.createPattern(schelleImg, 'repeat');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment