diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-11-21 22:50:57 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-11-21 22:50:57 -0500 |
commit | 8976f4d15c151afaf2249c526c6a42463e98f491 (patch) | |
tree | 990ee2b73ad171b0d04fc199e6d20242e80da8da /assets/js/src/CumulativeFlowDiagram.js | |
parent | a3bb27109dc01fa5df2c771b84620f1e8f56b849 (diff) |
Use components to render charts
Diffstat (limited to 'assets/js/src/CumulativeFlowDiagram.js')
-rw-r--r-- | assets/js/src/CumulativeFlowDiagram.js | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/assets/js/src/CumulativeFlowDiagram.js b/assets/js/src/CumulativeFlowDiagram.js deleted file mode 100644 index b22fd2e9..00000000 --- a/assets/js/src/CumulativeFlowDiagram.js +++ /dev/null @@ -1,55 +0,0 @@ -Kanboard.CumulativeFlowDiagram = function(app) { - this.app = app; -}; - -Kanboard.CumulativeFlowDiagram.prototype.execute = function() { - if (this.app.hasId("analytic-cfd")) { - this.show(); - } -}; - -Kanboard.CumulativeFlowDiagram.prototype.show = function() { - var chart = $("#chart"); - var metrics = chart.data("metrics"); - var columns = []; - var groups = []; - var categories = []; - var inputFormat = d3.time.format("%Y-%m-%d"); - var outputFormat = d3.time.format(chart.data("date-format")); - - for (var i = 0; i < metrics.length; i++) { - - for (var j = 0; j < metrics[i].length; j++) { - - if (i == 0) { - columns.push([metrics[i][j]]); - - if (j > 0) { - groups.push(metrics[i][j]); - } - } - else { - - columns[j].push(metrics[i][j]); - - if (j == 0) { - categories.push(outputFormat(inputFormat.parse(metrics[i][j]))); - } - } - } - } - - c3.generate({ - data: { - columns: columns, - type: 'area-spline', - groups: [groups] - }, - axis: { - x: { - type: 'category', - categories: categories - } - } - }); -}; |