diff options
Diffstat (limited to 'assets')
-rw-r--r-- | assets/css/app.css | 11 | ||||
-rw-r--r-- | assets/css/base.css | 1 | ||||
-rw-r--r-- | assets/css/pagination.css | 6 | ||||
-rw-r--r-- | assets/css/table.css | 4 | ||||
-rw-r--r-- | assets/js/analytic.js | 54 | ||||
-rw-r--r-- | assets/js/app.js | 54 |
6 files changed, 118 insertions, 12 deletions
diff --git a/assets/css/app.css b/assets/css/app.css index a23fca2d..e97a68c2 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -18,6 +18,7 @@ body { body { margin-left: 10px; margin-right: 10px; + padding-bottom: 20px; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; @@ -130,6 +131,10 @@ th a:hover { width: 10%; } +.column-15 { + width: 15%; +} + .column-20 { width: 20%; } @@ -1078,15 +1083,15 @@ tr td.task-orange, } /* pagination */ -#pagination { +.pagination { text-align: center; } -#pagination-next { +.pagination-next { margin-left: 5px; } -#pagination-previous { +.pagination-previous { margin-right: 5px; }/* popover */ #popover-container { diff --git a/assets/css/base.css b/assets/css/base.css index 0ebf907d..4a80d5b6 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -17,6 +17,7 @@ body { body { margin-left: 10px; margin-right: 10px; + padding-bottom: 20px; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; diff --git a/assets/css/pagination.css b/assets/css/pagination.css index 3459507c..6809bc22 100644 --- a/assets/css/pagination.css +++ b/assets/css/pagination.css @@ -4,14 +4,14 @@ } /* pagination */ -#pagination { +.pagination { text-align: center; } -#pagination-next { +.pagination-next { margin-left: 5px; } -#pagination-previous { +.pagination-previous { margin-right: 5px; }
\ No newline at end of file diff --git a/assets/css/table.css b/assets/css/table.css index c5ddb4c0..1a1e52a7 100644 --- a/assets/css/table.css +++ b/assets/css/table.css @@ -66,6 +66,10 @@ th a:hover { width: 10%; } +.column-15 { + width: 15%; +} + .column-20 { width: 20%; } diff --git a/assets/js/analytic.js b/assets/js/analytic.js index 32d3037a..22fb672e 100644 --- a/assets/js/analytic.js +++ b/assets/js/analytic.js @@ -4,15 +4,18 @@ Kanboard.Analytic = (function() { return { Init: function() { - if (Kanboard.Exists("analytic-repartition")) { - Kanboard.Analytic.Repartition.Init(); + if (Kanboard.Exists("analytic-task-repartition")) { + Kanboard.Analytic.TaskRepartition.Init(); + } + else if (Kanboard.Exists("analytic-user-repartition")) { + Kanboard.Analytic.UserRepartition.Init(); } } }; })(); -Kanboard.Analytic.Repartition = (function() { +Kanboard.Analytic.TaskRepartition = (function() { function fetchData() { @@ -56,3 +59,48 @@ Kanboard.Analytic.Repartition = (function() { }; })(); + +Kanboard.Analytic.UserRepartition = (function() { + + function fetchData() + { + jQuery.getJSON($("#chart").attr("data-url"), function(data) { + drawGraph(data.metrics, data.labels); + }); + } + + function drawGraph(metrics, labels) + { + var series = prepareSeries(metrics, labels); + + var svg = dimple.newSvg("#chart", 700, 350); + + var chart = new dimple.chart(svg, series); + chart.addMeasureAxis("p", labels["nb_tasks"]); + var ring = chart.addSeries(labels["user"], dimple.plot.pie); + ring.innerRadius = "50%"; + chart.addLegend(0, 0, 100, 100, "left"); + chart.draw(); + } + + function prepareSeries(metrics, labels) + { + var series = []; + + for (var i = 0; i < metrics.length; i++) { + + var serie = {}; + serie[labels["nb_tasks"]] = metrics[i]["nb_tasks"]; + serie[labels["user"]] = metrics[i]["user"]; + + series.push(serie); + } + + return series; + } + + return { + Init: fetchData + }; + +})(); diff --git a/assets/js/app.js b/assets/js/app.js index 55bc4039..ed017b0b 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -273,15 +273,18 @@ Kanboard.Analytic = (function() { return { Init: function() { - if (Kanboard.Exists("analytic-repartition")) { - Kanboard.Analytic.Repartition.Init(); + if (Kanboard.Exists("analytic-task-repartition")) { + Kanboard.Analytic.TaskRepartition.Init(); + } + else if (Kanboard.Exists("analytic-user-repartition")) { + Kanboard.Analytic.UserRepartition.Init(); } } }; })(); -Kanboard.Analytic.Repartition = (function() { +Kanboard.Analytic.TaskRepartition = (function() { function fetchData() { @@ -325,6 +328,51 @@ Kanboard.Analytic.Repartition = (function() { }; })(); + +Kanboard.Analytic.UserRepartition = (function() { + + function fetchData() + { + jQuery.getJSON($("#chart").attr("data-url"), function(data) { + drawGraph(data.metrics, data.labels); + }); + } + + function drawGraph(metrics, labels) + { + var series = prepareSeries(metrics, labels); + + var svg = dimple.newSvg("#chart", 700, 350); + + var chart = new dimple.chart(svg, series); + chart.addMeasureAxis("p", labels["nb_tasks"]); + var ring = chart.addSeries(labels["user"], dimple.plot.pie); + ring.innerRadius = "50%"; + chart.addLegend(0, 0, 100, 100, "left"); + chart.draw(); + } + + function prepareSeries(metrics, labels) + { + var series = []; + + for (var i = 0; i < metrics.length; i++) { + + var serie = {}; + serie[labels["nb_tasks"]] = metrics[i]["nb_tasks"]; + serie[labels["user"]] = metrics[i]["user"]; + + series.push(serie); + } + + return series; + } + + return { + Init: fetchData + }; + +})(); // Initialization $(function() { |