Our state of the art Gantt chart


Post by shaveta »

Hi
In some cases (depending on data) PercentDone attribute for parent nodes gets miscalculated.
It is most visible when all child nodes are 100% done but parent gets 99.9999999%.

also try to use

* calculatePercentDone() {
        // for leaf tasks use "percentDone" field value as-is
        const defaultValue = yield * super.calculatePercentDone();
        debugger
        if (this.percentDone > 99.99) {
            return Math.round(this.percentDone);
        }
        return this.percentDone
        // return Math.round(result);
    }
    

but this not helping as its giving 0 for top parent project row.


Post by alex.l »

Hi, shaveta

Please provide data to reproduce that and we will debug and fix it.

All the best,
Alex


Post by shaveta »

alex.l wrote: Mon Mar 27, 2023 11:41 am

Hi, shaveta

Please provide data to reproduce that and we will debug and fix it.

Please have a look at the attached data set and how it renders in UI

data.json
(4.61 KiB) Downloaded 19 times
image (1).png
image (1).png (39.53 KiB) Viewed 184 times

Post by arcady »

What is this?

"hoursPerDay": 23.99,

Every time you convert a duration value expressed in days to some smaller unit it uses that ratio.
After using that ratio for Child 1 1 task 71 day duration will be calculated to 6131843999.999999 milliseconds. And this happens for all child tasks.
And then a summary task percentDone is calculated as: percentDone = childrenCompletedDuration / childrenTotalDuration
So we sum up all children float values of durations and divide them by another float value.

Providing a float ratio you get float values on every step ..so having a float result in the end is expected


Post Reply