diff --git a/site/coa/stats/stats.js b/site/coa/stats/stats.js index b5e2674..b254f4f 100644 --- a/site/coa/stats/stats.js +++ b/site/coa/stats/stats.js @@ -1,33 +1,33 @@ $(document).ready(function () { - $.getJSON("../../data/chat_stat_monthly.json", function (datas) { - updated = datas['updated'] + $.getJSON("../../data/chat_stat_monthly.json", function (data) { + updated = data['updated'] - labels = datas['labels']; + labels = data['labels']; - graphDisplay($('#byChannel'), datas['messagesByChannel'], "Nombre de message par canaux sur 1 an (" + updated + ")"); + graphDisplay($('#byChannel'), data['messagesByChannel'], "Nombre de message par canaux sur 1 an (" + updated + ")"); - graphDisplay($('#byTsunamy'), datas['messagesByTsunamy'], "Nombre de message par Tsunami sur 1 an (" + updated + ")"); + graphDisplay($('#byTsunamy'), data['messagesByTsunamy'], "Nombre de message par Tsunami sur 1 an (" + updated + ")"); - graphDisplay($("#usersByChannel"), datas['usersByChannel'], "Nombre d'utilisateur actifs par canaux sur 1 an (" + updated + ")"); + graphDisplay($("#usersByChannel"), data['usersByChannel'], "Nombre d'utilisateur actifs par canaux sur 1 an (" + updated + ")"); - graphDisplay($("#usersGlobal"), datas['usersGlobal'], "Nombre d'utilisateur actifs sur 1 an (" + updated + ")"); + graphDisplay($("#usersGlobal"), data['usersGlobal'], "Nombre d'utilisateur actifs sur 1 an (" + updated + ")"); }); - $.getJSON("../../data/chat_stat_daily.json", function (datas) { - updated = datas['updated'] + $.getJSON("../../data/chat_stat_daily.json", function (data) { + updated = data['updated'] - labels = datas['labels']; + labels = data['labels']; - graphDisplay($('#byChannel_daily'), datas['messagesByChannel'], "Nombre de message par canaux sur 30 jours (" + updated + ")"); + graphDisplay($('#byChannel_daily'), data['messagesByChannel'], "Nombre de message par canaux sur 30 jours (" + updated + ")"); - graphDisplay($('#byTsunamy_daily'), datas['messagesByTsunamy'], "Nombre de message par Tsunami sur 30 jours (" + updated + ")"); + graphDisplay($('#byTsunamy_daily'), data['messagesByTsunamy'], "Nombre de message par Tsunami sur 30 jours (" + updated + ")"); - graphDisplay($("#usersByChannel_daily"), datas['usersByChannel'], "Nombre d'utilisateur actifs par canaux sur 30 jours (" + updated + ")"); + graphDisplay($("#usersByChannel_daily"), data['usersByChannel'], "Nombre d'utilisateur actifs par canaux sur 30 jours (" + updated + ")"); - graphDisplay($("#usersGlobal_daily"), datas['usersGlobal'], "Nombre d'utilisateur actifs sur 30 jours (" + updated + ")"); + graphDisplay($("#usersGlobal_daily"), data['usersGlobal'], "Nombre d'utilisateur actifs sur 30 jours (" + updated + ")"); }); }); -function graphDisplay(ctx, datas, title) { +function graphDisplay(ctx, data, title) { var chart = new Chart(ctx, { // The type of chart we want to create type: 'bar', @@ -35,7 +35,7 @@ function graphDisplay(ctx, datas, title) { // The data for our dataset data: { labels: labels, - datasets: datas, + datasets: data, }, // Configuration options go here