Search code examples
highchartsgantt-charthighcharts-gantt

How Can I add sections of categories in gantt highcharts?


enter image description here

I am using gantt highcharts in my angular application. In Gantt highcharts, I need to add sections of categories(general processes and Products) which are highlighted in red color. tried many solutions but didn't get the solutions. Kindly help.


Solution

  • At the beginning of your data sets, you can insert points only with a name property.

    Highcharts.ganttChart('container', {
        series: [{
            name: 'Offices',
            data: [{
                name: 'Section 1'
            }, {
                name: 'New offices',
                id: 'new_offices',
                owner: 'Peter'
            }, ...]
        }, {
            name: 'Product',
            data: [{
                name: 'Section 2'
            }, {
                name: 'New product launch',
                id: 'new_product',
                owner: 'Peter'
            }, ...]
        }],
        ...
    });
    

    Live demo: https://jsfiddle.net/BlackLabel/3knLtr8g/