From 3d76eccf4e558f8d06583e30932afcaff91749cd Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 15 Jan 2017 15:16:39 +0100 Subject: rework and redesign API demo --- examples/dashboard/templates/stats.js | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 examples/dashboard/templates/stats.js (limited to 'examples/dashboard/templates/stats.js') 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 }} + }); +}); -- cgit v1.3.1