 # Overlay sample is incorrect

#1

Hi,

I’ve tried the overlay sample because i want to intergrate it to my project but this sample doesn’t work well.
The real progress in the graph is incorrect.

Way to reproduce with the sample code without modification :

• delete all tasks
• create a task with duration = 2 days
• after the first task, create a second task with duration = 2 days

If i put 100% progress on the first task and 50% progress on the second, on the middle of the second task, the graph indicate : planned=75% and real=63%.
The real progress should be 75%.
No ?

#2

Hello,
I see that the final progress is 100%/75%.
If you hover the mouse over the previous day, you will see 75%/63%.
The displayed value depends on the point you highlight:

#3

How can the script find 63% ?

In the previous day, i see : planned 75%, real 63%
Why the real value is 63% ? That correspond to nothing.
The normal value should be 75% for both planned and real. No ?

#4

Hello,
The dev team decided that if you calculate the progress, it should consider days when calculating the total progress.
Here is a small demonstration of how it calculates the progress:

Day 1: half of task #1 + 0 + 0 + 0
Day 2: half of task #1 + half of task #1 + 0 + 0
Day 3: half of task #1 + half of task #1 + half of task #2 + 0
Day 4: half of task #1 + half of task #1 + half of task #2 + half of task #2

Task #1 progress: 100%.
half of task #1 progress: 100% / 2 = 50%;
Task #2 progress: 50%.
half of task #1 progress: 50% / 2 = 25%;

Total progress:
Day 1: (50% + 0% + 0% + 0%) / 2 tasks = 25%
Day 2: (50% + 50% + 0% + 0%) / 2 tasks = (100% + 0%) / 2 tasks = 50%
Day 3: (50% + 50% + 25% + 0%) / 2 tasks = (100% + 25%) / 2 tasks = (125%) / 2 tasks = 62.5%
Day 4: (50% + 50% + 25% + 25%) / 2 tasks = (100% + 50%) / 2 tasks = (150%) / 2 tasks = 75%

You can use any logic in the overlay configuration.

#5

I don’t think it’s the good way to calculate it.
Why to not calculate like this for each day :

total_sum = sum of duration of all task duration
progress sum = Sum of (duration X % progress) of each task :

total progress = progress sum / total sum X 100

Why do you think of it ?

#6

Hello,
It might be a good way to change the logic, but actually, there are 3 things:
`real`, `actual` and `predicted`:

And `predicted` uses `real` and `actual` values.

Do you want to see a snippet where your logic is applied?