mirror of
https://github.com/YunoHost-Apps/kanboard_ynh.git
synced 2024-09-03 19:36:17 +02:00
25 lines
579 B
JavaScript
25 lines
579 B
JavaScript
Kanboard.UserRepartitionChart = function(app) {
|
|
this.app = app;
|
|
};
|
|
|
|
Kanboard.UserRepartitionChart.prototype.execute = function() {
|
|
if (this.app.hasId("analytic-user-repartition")) {
|
|
this.show();
|
|
}
|
|
};
|
|
|
|
Kanboard.UserRepartitionChart.prototype.show = function() {
|
|
var metrics = $("#chart").data("metrics");
|
|
var columns = [];
|
|
|
|
for (var i = 0; i < metrics.length; i++) {
|
|
columns.push([metrics[i].user, metrics[i].nb_tasks]);
|
|
}
|
|
|
|
c3.generate({
|
|
data: {
|
|
columns: columns,
|
|
type : 'donut'
|
|
}
|
|
});
|
|
};
|