diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-09-03 20:39:13 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-09-03 20:39:13 -0400 |
commit | 8c07a0d03e64227c552f3b4530d3a1e1ba53402b (patch) | |
tree | 1d60285831f41beae2067fe55bd820affda6ebe3 /assets/js/components/chart-project-task-distribution.js | |
parent | 59fd3c366cd34cf1be3f20d44b424107c88c030b (diff) |
Convert task distribution chart to Vue.js component
Diffstat (limited to 'assets/js/components/chart-project-task-distribution.js')
-rw-r--r-- | assets/js/components/chart-project-task-distribution.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/assets/js/components/chart-project-task-distribution.js b/assets/js/components/chart-project-task-distribution.js new file mode 100644 index 00000000..b5d712ce --- /dev/null +++ b/assets/js/components/chart-project-task-distribution.js @@ -0,0 +1,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' + } + }); + } +}); |