diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-01-15 15:16:39 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-01-15 15:16:39 +0100 |
| commit | 3d76eccf4e558f8d06583e30932afcaff91749cd (patch) | |
| tree | 4ccb5a4289183a05e88570ae53d6f99d201b156f /examples/dashboard/templates/stats.js | |
| parent | 7422d6f86dffb6f0bf7cb015e188bc62c0f1111e (diff) | |
| download | python-gamelocker-3d76eccf4e558f8d06583e30932afcaff91749cd.tar.gz python-gamelocker-3d76eccf4e558f8d06583e30932afcaff91749cd.zip | |
rework and redesign API demo
Diffstat (limited to 'examples/dashboard/templates/stats.js')
| -rw-r--r-- | examples/dashboard/templates/stats.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/examples/dashboard/templates/stats.js b/examples/dashboard/templates/stats.js new file mode 100644 index 0000000..cb68641 --- /dev/null +++ b/examples/dashboard/templates/stats.js @@ -0,0 +1,62 @@ +$(function () { + Highcharts.chart("gameType", { + chart: { + type: "pie" + }, + title: { + text: "Game modes over the last {{ stats.number }} matches" + }, + series: [{ + data: {{ stats.gameModes|tojson|safe }} + }] + }); + Highcharts.chart("players", { + chart: { + type: "bar" + }, + xAxis: { + categories: ["matches"] + }, + title: { + text: "Most active players" + }, + series: {{ stats.players|tojson|safe }} + }); + Highcharts.chart("picks", { + chart: { + type: "column" + }, + title: { + text: "Popular picks" + }, + plotOptions: { + column: { + stacking: "normal" + } + }, + xAxis: { + categories: {{ stats.heroes|tojson|safe }} + }, + series: {{ stats.picks|tojson|safe }} + }); + Highcharts.chart("durations", { + chart: { + type: "scatter" + }, + yAxis: { + title: { + text: "length in minutes" + } + }, + xAxis: { + labels: { + enabled: false + }, + tickInterval: 1, + }, + title: { + text: "Game durations" + }, + series: {{ stats.durations|tojson|safe }} + }); +}); |
