https://www.jqwidgets.com/

jQuery Gantt: Task Indicators

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", {
         view: 'day',
         treeSize: '25%',
         height: 'auto',
         durationUnit: 'hour',
         taskColumns: [
             {
                 label: 'Employee',
                 value: 'label'
             },
             {
                 label: 'From',
                 value: 'dateStart'
             },
             {
                 label: 'Office Time',
                 value: 'duration',
                 size: '20%'
             }
         ],
         source: [
             {
                 label: 'Beth',
                 dateStart: '2026-10-28T07:30:00',
                 duration: 8,
                 class: 'beth',
                 progress: 45,
                 segments: [
                     {
                         label: 'Morning',
                         dateStart: '2026-10-28T07:30:00',
                         dateEnd: '2026-10-28T11:30:00'
                     },
                     {
                         label: 'Afternoon',
                         dateStart: '2026-10-28T13:00:00',
                         dateEnd: '2026-10-28T17:30:00'
                     }
                 ],
                 indicators: [
                     {
                         label: 'Lunch Break',
                         date: '2026-10-28T11:45:00',
                         className: 'material-icons',
                         icon: '\\e56c'
                     }
                 ]
             },
             {
                 label: 'William',
                 dateStart: '2026-10-28T08:00:00',
                 duration: 8,
                 class: 'william',
                 progress: 25,
                 segments: [
                     {
                         label: 'Morning',
                         dateStart: '2026-10-28T08:00:00',
                         dateEnd: '2026-10-28T12:00:00'
                     },
                     {
                         label: 'Afternoon',
                         dateStart: '2026-10-28T13:15:00',
                         dateEnd: '2026-10-28T17:30:00'
                     }
                 ],
                 indicators: [
                     {
                         label: 'Lunch Break',
                         date: '2026-10-28T12:15:00',
                         className: 'material-icons',
                         icon: '\\ea64'
                     }
                 ]
             },
             {
                 label: 'Emma',
                 dateStart: '2026-10-28T09:30:00',
                 duration: 9,
                 class: 'emma',
                 progress: 50,
                 segments: [
                     {
                         dateStart: '2026-10-28T09:30:00',
                         dateEnd: '2026-10-28T12:00:00',
                     },
                     {
                         dateStart: '2026-10-28T13:30:00',
                         dateEnd: '2026-10-28T15:00:00',
                     },
                     {
                         dateStart: '2026-10-28T16:30:00',
                         dateEnd: '2026-10-28T18:00:00',
                     }
                 ],
                 indicators: [
                     {
                         label: 'Preview Docs',
                         date: '2026-10-28T08:00:00',
                         className: 'material-icons',
                         icon: '\\f040',
                         tooltip: 'Preview the documents'
                     },
                     {
                         label: 'Lunch Break',
                         date: '2026-10-28T12:15:00',
                         className: 'material-icons',
                         icon: '\\f1e9'
                     },
                     {
                         label: 'Metting',
                         date: '2026-10-28T15:15:00',
                         className: 'material-icons',
                         icon: '\\f233'
                     }
                 ]
             },
             {
                 label: 'Team Oliver',
                 synchronized: true,
                 class: 'team-oliver',
                 expanded: true,
                 indicators: [
                     {
                         label: 'Metting',
                         date: '2026-10-28T08:00:00',
                         className: 'material-icons',
                         icon: '\\f233',
                         tooltip: 'Lunch Break End'
                     }
                 ],
                 tasks: [
                     {
                         label: 'Oliver',
                         dateStart: '2026-10-28T010:30:00',
                         duration: 7.5,
                         class: 'oliver',
                         progress: 75,
                     },
                     {
                         label: 'Jason',
                         dateStart: '2026-10-28T09:30:00',
                         duration: 9,
                         class: 'jason',
                         progress: 15
                     },
                     {
                         label: 'Alex',
                         dateStart: '2026-10-28T09:00:00',
                         duration: 10,
                         class: 'alex',
                         progress: 15,
                         indicators: [
                             {
                                 label: 'Lock',
                                 date: '2026-10-28T19:10:00',
                                 className: 'material-icons',
                                 icon: '\\e73c',
                                 tooltip: 'Remember to lock the office door'
                             }
                         ]
                     }
                 ]
             },
             {
                 label: 'Lucas',
                 dateStart: '2026-10-28T13:00:00',
                 duration: 4,
                 class: 'lucas',
                 indicators: [
                     {
                         label: 'Late',
                         date: '2026-10-28T12:00:00',
                         className: 'material-icons',
                         icon: '\\e8b5',
                         tooltip: 'Late for work'
                     },
                     {
                         label: 'Early',
                         date: '2026-10-28T17:10:00',
                         className: 'material-icons',
                         icon: '\\f1bb',
                         tooltip: 'Left early today'
                     }
                 ]
             },
             {
                 label: 'Michael',
                 dateStart: '2026-10-28T11:00:00',
                 duration: 8,
                 class: 'michael',
                 indicators: [
                     {
                         date: '2026-10-28T10:30:00',
                         className: 'material-icons',
                         icon: '\\e7fe',
                         tooltip: 'The new guy'
                     }
                 ]
             }
         ]
     });
 };

body.html

<div>

</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