summaryrefslogtreecommitdiff
path: root/assets/js/src/CumulativeFlowDiagram.js
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-20 15:45:02 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-20 15:45:02 -0400
commitf77d6c590bf683377986064113ddddae9ed443c2 (patch)
tree9ac56f1658814c381cdc161492454143e5d0462a /assets/js/src/CumulativeFlowDiagram.js
parent787e91ca415ff2282a1b3328c6a1b28b23596ddc (diff)
Added Markdown editor and Javascript code refactoring
Diffstat (limited to 'assets/js/src/CumulativeFlowDiagram.js')
-rw-r--r--assets/js/src/CumulativeFlowDiagram.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/assets/js/src/CumulativeFlowDiagram.js b/assets/js/src/CumulativeFlowDiagram.js
index 61a0847b..b22fd2e9 100644
--- a/assets/js/src/CumulativeFlowDiagram.js
+++ b/assets/js/src/CumulativeFlowDiagram.js
@@ -1,14 +1,21 @@
-function CumulativeFlowDiagram() {
-}
+Kanboard.CumulativeFlowDiagram = function(app) {
+ this.app = app;
+};
-CumulativeFlowDiagram.prototype.execute = function() {
+Kanboard.CumulativeFlowDiagram.prototype.execute = function() {
+ if (this.app.hasId("analytic-cfd")) {
+ this.show();
+ }
+};
- var metrics = $("#chart").data("metrics");
+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"));
+ var outputFormat = d3.time.format(chart.data("date-format"));
for (var i = 0; i < metrics.length; i++) {