summaryrefslogtreecommitdiff
path: root/examples/dashboard/templates/stats.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dashboard/templates/stats.js')
-rw-r--r--examples/dashboard/templates/stats.js62
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 }}
+ });
+});