summaryrefslogtreecommitdiff
path: root/assets/js/components/chart-project-task-distribution.js
blob: 982aaf7fa1de7ae4ce09cb4ebfcf0f627a6b886a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
KB.component('chart-project-task-distribution', function (containerElement, options) {

    this.render = function () {
        var columns = [];

        for (var i = 0; i < options.metrics.length; i++) {
            columns.push([options.metrics[i].column_title, options.metrics[i].nb_tasks]);
        }

        KB.el(containerElement).add(KB.el('div').attr('id', 'chart').build());

        c3.generate({
            data: {
                columns: columns,
                type : 'donut'
            }
        });
    };
});