[Chartjs]-Calculate Ideal Burndown

2👍

Well, of course you end up one increment short, because you shift to a zero based index and multiply with that.

Your first iteration is

ideal.push(idealIncrement * 0);

robbing you of your first increment.

change

ideal.push(idealIncrement * i);

to

ideal.push(idealIncrement * (i+1));

and you should be able to go on with your current strategy.
Or, which is better to read, start your for loop at i=1 and go all the way up to totaldays, that works fine too. No need to start at 0 since you don’t access the array index anywhere in that loop.

0👍

I think the logic in your code is solid. A burndown chart plots the work you should have at the end of the day for each day in a sprint, right? So if you set the first day to the full 148.5 you rob yourself of a days work. It should really start at 133.65 as that would be where you should be at the end of day 1.

Leave a comment