https://www.jqwidgets.com/

jQuery Gantt: Default Functionality

JavaScript Gantt.

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', {
         treeSize: '30%',
         durationUnit: 'hour',
         height: 'auto',
         taskColumns: [
             {
                 label: 'Tasks',
                 value: 'label',
                 size: '60%'
             },
             {
                 label: 'Duration (hours)',
                 value: 'duration',
                 formatFunction: (date) => parseInt(date)
             }
         ],
         source: [
             {
                 label: 'PRD & User-Stories',
                 dateStart: '2026-01-06',
                 dateEnd: '2026-03-06',
                 class: 'product-team',
                 type: 'task'
             },
             {
                 label: 'Persona & Journey',
                 dateStart: '2026-02-25',
                 dateEnd: '2026-04-26',
                 class: 'marketing-team',
                 type: 'task'
             },
             {
                 label: 'Architecture',
                 dateStart: '2026-04-07',
                 dateEnd: '2026-05-12',
                 class: 'product-team',
                 type: 'task'
             },
             {
                 label: 'Prototyping',
                 dateStart: '2026-05-13',
                 dateEnd: '2026-06-27',
                 class: 'dev-team',
                 type: 'task'
             },
             {
                 label: 'Design',
                 dateStart: '2026-06-28',
                 dateEnd: '2026-07-28',
                 class: 'design-team',
                 type: 'task'
             },
             {
                 label: 'Development',
                 dateStart: '2026-07-28',
                 dateEnd: '2026-09-06',
                 class: 'dev-team',
                 type: 'task'
             },
             {
                 label: 'Testing & QA',
                 dateStart: '2026-09-07',
                 dateEnd: '2026-10-06',
                 class: 'qa-team',
                 type: 'task'
             },
             {
                 label: 'UAT Test',
                 dateStart: '2026-10-08',
                 dateEnd: '2026-11-07',
                 class: 'product-team',
                 type: 'task'
             },
             {
                 label: 'Handover & Documentation',
                 dateStart: '2026-10-13',
                 dateEnd: '2026-11-27',
                 class: 'marketing-team',
                 type: 'task'
             },
             {
                 label: 'Release',
                 dateStart: '2026-10-28',
                 dateEnd: '2026-12-27',
                 class: 'release-team',
                 type: 'task'
             }
         ]
     });

 };

body.html

<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