Description: The Resource Timeline displays a histogram of the working time of the resources. The resources represent people that are assigned to different tasks. The resource properties capacity and maxCapacity determines the capacity and maximal capacity that a person can spend working on a task. If the capacity is above the maximum possible it is colored in red in the histogram.

https://www.jqwidgets.com/

jQuery Gantt: Resources Timeline mode Histogram

A live JavaScript/jQuery example of jqxGantt, the jQWidgets Gantt component, with its complete source code below. It is one of 15 jqxGantt demos for jQuery.

jqxGantt API used in this demo

Source code

To run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $.

The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxgantt.js, jqxgantt.api.js.

It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers).

script.js

window.onload = () => {
     const gantt = new jqxGantt("#gantt", {
         source: [
             {
                 label: 'Preparing',
                 synchronized: true,
                 expanded: true,
                 disableResources: true,
                 tasks: [
                     {
                         label: 'Plan Finances',
                         dateStart: '2026-02-25',
                         dateEnd: '2026-03-01',
                         resources: [{
                             id: 'trina',
                             label: 'Trina',
                             maxCapacity: 8
                         }]
                     },
                     {
                         label: 'Find an Office',
                         dateStart: '2026-02-26',
                         dateEnd: '2026-03-01',
                         progress: 50,
                         resources: [{
                             id: 'michelle',
                             label: 'Michelle',
                             capacity: 4,
                             maxCapacity: 10,
                         }]
                     },
                     {
                         label: 'Hire Staff',
                         dateStart: '2026-02-26',
                         dateEnd: '2026-03-06',
                         resources: [{
                             id: 'melanie',
                             label: 'Melanie',
                             capacity: 8,
                             maxCapacity: 10,
                         }]
                     },
                     {
                         label: 'Staff Management',
                         dateStart: '2026-03-06',
                         dateEnd: '2026-03-11'
                     },
                     {
                         label: 'Schedule',
                         dateStart: '2026-03-06',
                         dateEnd: '2026-03-08',
                         resources: [{
                             id: 'david',
                             label: 'David',
                             maxCapacity: 8
                         }]
                     },
                 ]
             },
             {
                 label: 'Execution',
                 synchronized: true,
                 expanded: true,
                 disableResources: true,
                 tasks: [
                     {
                         label: 'Product Vision',
                         dateStart: '2026-03-11',
                         dateEnd: '2026-03-16',
                         resources: [{
                             id: 'chris',
                             label: 'Chris',
                             maxCapacity: 12
                         }]
                     },
                     {
                         label: 'Product Development',
                         dateStart: '2026-03-16',
                         dateEnd: '2026-03-27',
                         resources: 'chris'
                     },
                     {
                         label: 'Product Release',
                         dateStart: '2026-03-28',
                         dateEnd: '2026-04-01',
                         resources: [{
                             id: 'taylor',
                             label: 'Taylor',
                             capacity: 4,
                             maxCapacity: 4
                         }]
                     }
                 ]
             },
             {
                 label: 'Release',
                 synchronized: true,
                 expanded: true,
                 disableResources: true,
                 tasks: [
                     {
                         label: 'Release Management',
                         dateStart: '2026-04-02',
                         dateEnd: '2026-04-06'
                     },
                     {
                         label: 'Updates',
                         dateStart: '2026-04-11',
                         dateEnd: '2026-04-27',
                         resources: 'chris'
                     },
                     {
                         label: 'Upgrades',
                         dateStart: '2026-04-27',
                         dateEnd: '2026-05-28',
                         resources: [{
                             id: 'brad',
                             label: 'Brad'
                         }]
                     }
                 ]
             },
             {
                 label: 'Support',
                 synchronized: true,
                 expanded: true,
                 disableResources: true,
                 tasks: [
                     {
                         label: 'QA',
                         dateStart: '2026-03-28',
                         dateEnd: '2026-04-27',
                         resources: 'chris'
                     },
                     {
                         label: 'Customer Service',
                         dateStart: '2026-03-28',
                         dateEnd: '2026-05-27',
                         resources: 'michelle'
                     },
                     {
                         label: 'Statistics and Data Analysis',
                         dateStart: '2026-03-28',
                         dateEnd: '2026-04-27'
                     }
                 ]
             }
         ],
         taskColumns: [
             {
                 label: 'Name',
                 value: 'label',
                 size: '40%'
             },
             {
                 label: 'From',
                 value: 'dateStart',
                 size: '20%'
             },
             {
                 label: 'To',
                 value: 'dateEnd',
                 size: '20%'
             },
             {
                 label: 'Owner',
                 value: 'resources'
             }
         ],
         resourceColumns: [
             {
                 label: 'Name',
                 value: 'label',
                 size: '40%'
             },
             {
                 label: 'Completion',
                 value: 'progress',
                 formatFunction: (data) => data + '%',
                 size: '20%'
             },
             {
                 label: 'Workload',
                 value: 'workload',
                 formatFunction: (data) => data + 'h',
                 size: '20%'
             },
             {
                 label: 'Capacity',
                 value: 'capacity',
                 formatFunction: (data) => data + 'h',
                 size: '20%'
             }
         ],
         treeMin: '25%',
         resourcePanelSize: '30%',
         resourceTimelineMode: 'histogram',
         view: 'week',
         timelineHeaderFormatFunction: function (date, type, isHeaderDetailsContainer) {
             const that = document.querySelector('jqx-gantt-chart');
             if (isHeaderDetailsContainer) {
                 return date.toLocaleDateString('en', { month: 'long', year: 'numeric' });
             }
             else {
                 return date.toLocaleDateString('en', { day: 'numeric', weekday: 'long' });
             }
         }
     })
 };

body.html

<div>
    <p>
        <b>Description:</b> The Resource Timeline displays a histogram of the working time of the resources. The
        resources represent people that are assigned to different tasks. The resource properties <b>capactiy</b> and
        <b>maxCapacity</b> determines the capacity and maximal capacity that a person can spend working on a task.
        If the capacity is above the maximum possible it is collered in red in the histogram.
    </p>
</div>
<div id="gantt"></div>
<div style="position: absolute; bottom: 5px; right: 5px;">
    <a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"></a>
</div>

Learn more

More jQuery Gantt demos