in this case, you need some custom data formatting. below you may find the code which takes the .csv data you provided us before, then parses it, groups and formats. after that creates gantt project chart. this code helps to get the data structure you want.

//parse .csv data and group by workstation_id
d3.csv("data.csv", function (data1) {
    var workstation = d3.nest()
        .key(function (d) {
            return d.workstation_id;

    //get formatted data as a tree
    var formatteddata = formatdata(workstation);

    //set formatted data as a tree
    var treedata =, "as-tree");
    // chart type
    chart = anychart.ganttproject();

    // set data for the chart;

    // set container id for the chart

    // fit all visible data to timeline.

//helper function to format data in apropriate way
//to set to the gantt chart
function formatdata(data) {

    var outputdata = [];

    data.foreach(function (item) {
        var itemobj = {};
        itemobj['name'] = item['key'];
        itemobj['children'] = [];

        var childs = item['values'];

        for (var i = 0; i < childs.length; i++) {
            var childobj = {};
            childobj['name'] = 'order id: ' + childs[i]['order_id'] + '-' + i;
            childobj['actualstart'] = new date(childs[i]['scheduledtime']).gettime();
            childobj['actualend'] = childobj['actualstart'] + childs[i]['duration(seconds)'] * 1000;
            childobj['order_id'] = childs[i]['order_id'];
    return outputdata;

below is a screenshot of the chart which is built by this code. enter image description here

Related Query