summaryrefslogtreecommitdiff
path: root/assets/js/components/chart-project-task-distribution.js
blob: b5d712cefe05868599c3afcb6496efa5ad644fbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Vue.component('chart-project-task-distribution', {
    props: ['metrics'],
    template: '<div id="chart"></div>',
    ready: function () {
        var columns = [];

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

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