Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

graph all the things!

  • Loading branch information...
commit 845baa19414c56f5e06b93ad7a37d0a3b6dc3dbb 1 parent 2e2118f
luke crouch authored March 30, 2012

Showing 1 changed file with 28 additions and 12 deletions. Show diff stats Hide diff stats

  1. 40  static/js/sprint.js
40  static/js/sprint.js
@@ -24,21 +24,37 @@
24 24
                 clickable: true,
25 25
                 markings: self.weekend_areas
26 26
             },
27  
-            lines: {
28  
-                show: true,
29  
-                fill: 0.4
30  
-            },
31  
-            points: {
32  
-                show: true,
33  
-                fill: true,
34  
-                radius: 4
35  
-            }
36 27
         };
37  
-        self.actual_plot = {data: bugs_data.burndown, color: '#049cdb'}
  28
+        self.actual_plot = {
  29
+            data: bugs_data.burndown, 
  30
+            color: '#049cdb',
  31
+            label: 'Actual',
  32
+            lines: { show: true, fill: 0.4},
  33
+            points: {show: true, fill: true, radius: 4}
  34
+        };
38 35
         self.ideal_plot = {data: [
39 36
             [bugs_data.burndown_axis[0], bugs_data['total_points']],
40 37
             [bugs_data.burndown_axis[bugs_data.burndown_axis.length-1], 0]
41  
-        ], lines: {fill: false}, points: {show: false}, color: '#0f0'};
  38
+        ], lines: {fill: false}, points: {show: false}, color: '#0f0', label: 'Ideal'};
  39
+        self.bug_plot = {data: bugs_data.bugdown, color: '#db9c04', label: 'Bugs'}
  40
+        self.completed_data = [];
  41
+        for (var i=0;i < bugs_data.burndown_axis.length; i++){
  42
+          var prev = i-1;
  43
+          if (prev < 0) {
  44
+              prev = 0;
  45
+          }
  46
+          if (bugs_data.burndown[i] === undefined){
  47
+            bugs_data.burndown[i] = 0;
  48
+          }
  49
+          self.completed_data.push([bugs_data.burndown_axis[i], bugs_data.burndown[prev][1]-bugs_data.burndown[i][1]]);
  50
+        }
  51
+        self.completed_plot = {
  52
+            data: self.completed_data,
  53
+            color: '#db9c04',
  54
+            label: 'Completed',
  55
+            bars: {show: true},
  56
+            points: {show: true, fill: true, radius: 4}
  57
+        };
42 58
 
43 59
         self.resize = function(){
44 60
             self.$element.css('height', function(){
@@ -90,7 +106,7 @@
90 106
 
91 107
         self.resize();
92 108
 
93  
-        $.plot(self.$element, [self.actual_plot, self.ideal_plot], self.base_options);
  109
+        $.plot(self.$element, [self.actual_plot, self.ideal_plot, self.completed_plot], self.base_options);
94 110
 
95 111
         self.$element.bind({
96 112
             plothover: self.plothover,

0 notes on commit 845baa1

Please sign in to comment.
Something went wrong with that request. Please try again.