anychart

How can I connect a single task to multiple successors in a Gantt Chart?


I am trying to create a Gantt chart and one of my tasks has 2 successors. How can I prepare the data so the 2 lines to the successors are drawn?


Solution

  • It's possible to configure multiple connectors to represent tasks with more than one successor in a Gantt chart.

    To achieve this, you can use the connector property in your data set to define connections between tasks. Below is an example:

    {
      id: "1",
      name: "Task 1",
      actualStart: "2023-12-10",
      actualEnd: "2023-12-15",
      connector: [
        {
          connectTo: "2",
          connectorType: "finish-start"
        },
        {
          connectTo: "3",
          connectorType: "finish-start"
        }
      ]
    }
    

    This example demonstrates how Task 1 connects to Task 2 and Task 3 using the finish-start connector type.

    For a practical demonstration, you can explore our Gantt chart with multiple task successors example on the AnyChart Playground, where the implementation details are available in lines 16–25.