Permalink
Browse files

graph all the things!

  • Loading branch information...
groovecoder committed Mar 30, 2012
1 parent 2e2118f commit 845baa19414c56f5e06b93ad7a37d0a3b6dc3dbb
Showing with 28 additions and 12 deletions.
  1. +28 −12 static/js/sprint.js
View
@@ -24,21 +24,37 @@
clickable: true,
markings: self.weekend_areas
},
- lines: {
- show: true,
- fill: 0.4
- },
- points: {
- show: true,
- fill: true,
- radius: 4
- }
};
- self.actual_plot = {data: bugs_data.burndown, color: '#049cdb'}
+ self.actual_plot = {
+ data: bugs_data.burndown,
+ color: '#049cdb',
+ label: 'Actual',
+ lines: { show: true, fill: 0.4},
+ points: {show: true, fill: true, radius: 4}
+ };
self.ideal_plot = {data: [
[bugs_data.burndown_axis[0], bugs_data['total_points']],
[bugs_data.burndown_axis[bugs_data.burndown_axis.length-1], 0]
- ], lines: {fill: false}, points: {show: false}, color: '#0f0'};
+ ], lines: {fill: false}, points: {show: false}, color: '#0f0', label: 'Ideal'};
+ self.bug_plot = {data: bugs_data.bugdown, color: '#db9c04', label: 'Bugs'}
+ self.completed_data = [];
+ for (var i=0;i < bugs_data.burndown_axis.length; i++){
+ var prev = i-1;
+ if (prev < 0) {
+ prev = 0;
+ }
+ if (bugs_data.burndown[i] === undefined){
+ bugs_data.burndown[i] = 0;
+ }
+ self.completed_data.push([bugs_data.burndown_axis[i], bugs_data.burndown[prev][1]-bugs_data.burndown[i][1]]);
+ }
+ self.completed_plot = {
+ data: self.completed_data,
+ color: '#db9c04',
+ label: 'Completed',
+ bars: {show: true},
+ points: {show: true, fill: true, radius: 4}
+ };
self.resize = function(){
self.$element.css('height', function(){
@@ -90,7 +106,7 @@
self.resize();
- $.plot(self.$element, [self.actual_plot, self.ideal_plot], self.base_options);
+ $.plot(self.$element, [self.actual_plot, self.ideal_plot, self.completed_plot], self.base_options);
self.$element.bind({
plothover: self.plothover,

0 comments on commit 845baa1

Please sign in to comment.