256MbTeam / Redmine-Scrumbler

Easy to use plugin for Redmine. It allows users to use the Scrum/Agile process in projects. Scrumbler have interactive dashboard with the ability to configure for each sprint. Plugin adds Scrum Points field in every issue in project. Scrumbler as possible using the standard redmine structure of projects.
GNU General Public License v2.0
112 stars 41 forks source link

Feature: Trend line in burndown #50

Open Hawkin opened 12 years ago

Hawkin commented 12 years ago

Hi all.

We found that there is a missing info in the burndown. This is the trend line. This line formed by initial point and actual point in the real data. This line will show you if the sprint is on time and the estimated date it will complete.

We thought that this is not and issue, this is a feature. And I was working on it and a solution in javacript. I copy the git diff if you want to include it in the graph.

$ git diff
diff --git a/app/views/scrumbler_sprints/burndown.html.erb b/app/views/scrumbler_sprints/burndown.html.erb
index 76a7195..2bb5a4d 100644
--- a/app/views/scrumbler_sprints/burndown.html.erb
+++ b/app/views/scrumbler_sprints/burndown.html.erb
@@ -39,6 +39,28 @@
                        current_extr = today
                };

+               var trend_val = real_data[real_data.length-1][1];
+               var trend_date = today;
+               var m = 0;
+               if ((trend_val != real_data[0][1]) && (trend_date != real_data[0][0])) {
+                       m = (trend_val - real_data[0][1]) / (trend_date - real_data[0][0]);
+               }
+
+               var trend_data = [];
+               for (i=0; i<real_data.length; ++i) {
+                       trend_date = real_data[i][0];
+                       trend_val = ((trend_date-real_data[0][0])*m) + real_data[0][1];
+                       if (trend_val < 0) trend_val = 0;
+                       trend_data.push([trend_date,trend_val]);
+               }
+
+               while (trend_val > 0) {
+                       trend_date += 86400000;
+                       trend_val = ((trend_date-real_data[0][0])*m) + real_data[0][1];
+                       if (trend_val >= 0)
+                               trend_data.push([trend_date,trend_val]);
+               }
+
                var chart = new Highcharts.StockChart({
                        chart : {
                                renderTo : 'scrumbler_burndown_chart'
@@ -72,6 +94,12 @@
                                }

                        }, {
+                               name : Scrumbler.Translations.scrumbler_statistics.trend_issues,
+                               data : trend_data,
+                               tooltip : {
+                                       yDecimals : 2
+                               }
+                       }, {
                                name : Scrumbler.Translations.scrumbler_statistics.ideal_issues,
                                data : normal_data,
                                tooltip : {

Best regards, and again, great job!