Convert task distribution chart to Vue.js component

This commit is contained in:
Frederic Guillot
2016-09-03 20:39:13 -04:00
parent 59fd3c366c
commit 8c07a0d03e
11 changed files with 35 additions and 42 deletions

View File

@@ -36,6 +36,10 @@ Kanboard.App.prototype.execute = function() {
this.datePicker();
this.autoComplete();
this.tagAutoComplete();
new Vue({
el: 'body'
});
};
Kanboard.App.prototype.keyboardShortcuts = function() {

View File

@@ -1,25 +0,0 @@
Kanboard.TaskRepartitionChart = function(app) {
this.app = app;
};
Kanboard.TaskRepartitionChart.prototype.execute = function() {
if (this.app.hasId("analytic-task-repartition")) {
this.show();
}
};
Kanboard.TaskRepartitionChart.prototype.show = function() {
var metrics = $("#chart").data("metrics");
var columns = [];
for (var i = 0; i < metrics.length; i++) {
columns.push([metrics[i].column_title, metrics[i].nb_tasks]);
}
c3.generate({
data: {
columns: columns,
type : 'donut'
}
});
};