Page 1 of 1

Resource Utilization - Consider Capacity

Posted: Wed Jun 07, 2023 1:18 pm
by srr

Hello

I would like my resource utilization widget to consider the resource capacity when calculating utilization.

I have implemented a change using the getBarText function so that the resource utilization figure shows as a percentage of total availability, rather than number of hours used.

To give you an example scenario, I have resource "D1" which has 1 machine in it, and assigned to that resource I have a job which uses 8h of 8h available on Friday 9th June. Currently this shows 100% utilization correctly. If I increase the resource capacity to 2 machines, with the same job assigned to the resource, I want the utilization to show 50% (8h of 16h available), rather than 100%.

Is this possible? If so, can you point me in the right direction please?

Thank you


Re: Resource Utilization - Consider Capacity

Posted: Thu Jun 08, 2023 3:28 pm
by alex.l

Hi,

I have implemented a change using the getBarText function

So you want to change your code to have behaviour you described? Can you please share your code then?


Re: Resource Utilization - Consider Capacity

Posted: Thu Jun 08, 2023 4:06 pm
by srr

Hi Alex,

I did wonder if I would need to amend my formula for calculating the percentage. If that is the case that's fine. I just wanted to check I wasn't overlooking some standard functionality that was already available.

Thanks


Re: Resource Utilization - Consider Capacity

Posted: Fri Jun 09, 2023 7:16 am
by arcady

There is no capacity support out of the box I'm afraid. We have a feature request but we haven't started on it yet.

If you want to implement this yourself you basically need to override calculateAllocation method of ResourceAllocationInfo class.

class MyResourceAllocationInfo extends ResourceAllocationInfo {

    * calculateAllocation() {
        ....
    }

}

const project = new ProjectModel({
    resourceAllocationInfoClass : MyResourceAllocationInfo,
    ...
});

new ResourceUtilization({
    project,
    ....
});

FYI The upcoming v5.4.0 release (on alpha-1 stage now) includes refactored resource utilization view which gives some more public ways for customization:
here is a new guide sneak peek for the view: https://www.bryntum.com/products/gantt-next/docs/guide/SchedulerPro/resourceviews/resourceutilization

P.S. Or you could sponsor the feature development to push its priority on our TODO list. Please reach out sales at bryntum.com for a quote if that works for you


Re: Resource Utilization - Consider Capacity

Posted: Tue Jun 13, 2023 10:11 am
by srr

Thanks arcady - as suggested I have implemented my own calculateAllocation method and all working as I need now.
Thanks for your help!