diff options
Diffstat (limited to 'assets/js/components')
-rw-r--r-- | assets/js/components/chart-project-avg-time-column.js (renamed from assets/js/components/chart-avg-time-column.js) | 2 | ||||
-rw-r--r-- | assets/js/components/chart-project-burndown.js (renamed from assets/js/components/chart-burndown.js) | 2 | ||||
-rw-r--r-- | assets/js/components/chart-project-cumulative-flow.js (renamed from assets/js/components/chart-cumulative-flow.js) | 2 | ||||
-rw-r--r-- | assets/js/components/chart-project-lead-cycle-time.js (renamed from assets/js/components/chart-lead-cycle-time.js) | 2 | ||||
-rw-r--r-- | assets/js/components/chart-task-time-column.js | 41 |
5 files changed, 45 insertions, 4 deletions
diff --git a/assets/js/components/chart-avg-time-column.js b/assets/js/components/chart-project-avg-time-column.js index 0fc85f71..74fe31de 100644 --- a/assets/js/components/chart-avg-time-column.js +++ b/assets/js/components/chart-project-avg-time-column.js @@ -1,4 +1,4 @@ -KB.component('chart-avg-time-column', function (containerElement, options) { +KB.component('chart-project-avg-time-column', function (containerElement, options) { this.render = function () { var metrics = options.metrics; diff --git a/assets/js/components/chart-burndown.js b/assets/js/components/chart-project-burndown.js index 0bb96742..34a01e4a 100644 --- a/assets/js/components/chart-burndown.js +++ b/assets/js/components/chart-project-burndown.js @@ -1,4 +1,4 @@ -KB.component('chart-burndown', function (containerElement, options) { +KB.component('chart-project-burndown', function (containerElement, options) { this.render = function () { var metrics = options.metrics; diff --git a/assets/js/components/chart-cumulative-flow.js b/assets/js/components/chart-project-cumulative-flow.js index d1e05590..aa150397 100644 --- a/assets/js/components/chart-cumulative-flow.js +++ b/assets/js/components/chart-project-cumulative-flow.js @@ -1,4 +1,4 @@ -KB.component('chart-cumulative-flow', function (containerElement, options) { +KB.component('chart-project-cumulative-flow', function (containerElement, options) { this.render = function () { var metrics = options.metrics; diff --git a/assets/js/components/chart-lead-cycle-time.js b/assets/js/components/chart-project-lead-cycle-time.js index db7767d2..a81937ff 100644 --- a/assets/js/components/chart-lead-cycle-time.js +++ b/assets/js/components/chart-project-lead-cycle-time.js @@ -1,4 +1,4 @@ -KB.component('chart-lead-cycle-time', function (containerElement, options) { +KB.component('chart-project-lead-cycle-time', function (containerElement, options) { this.render = function () { var metrics = options.metrics; diff --git a/assets/js/components/chart-task-time-column.js b/assets/js/components/chart-task-time-column.js new file mode 100644 index 00000000..02426748 --- /dev/null +++ b/assets/js/components/chart-task-time-column.js @@ -0,0 +1,41 @@ +KB.component('chart-task-time-column', function (containerElement, options) { + + this.render = function () { + var metrics = options.metrics; + var plots = [options.label]; + var categories = []; + + for (var i = 0; i < metrics.length; i++) { + plots.push(metrics[i].time_spent); + categories.push(metrics[i].title); + } + + KB.el(containerElement).add(KB.el('div').attr('id', 'chart').build()); + + c3.generate({ + data: { + columns: [plots], + type: 'bar' + }, + bar: { + width: { + ratio: 0.5 + } + }, + axis: { + x: { + type: 'category', + categories: categories + }, + y: { + tick: { + format: KB.utils.formatDuration + } + } + }, + legend: { + show: false + } + }); + }; +});
\ No newline at end of file |