Build a Gantt Chart

Use Gantt charts to show the duration of events or activities.

In a Gantt chart, each separate mark (usually a bar) shows a duration. For example, you might use a Gantt chart to display average delivery time for a range of products.

The basic building blocks for a gantt chart are as follows:

Mark type:

Automatic or Gantt Bar

Columns shelf:

Date or Time field (continuous measure)

Rows shelf:

Dimension(s)

Size:

Continuous measure

For more information about the Gantt bar mark type, see Gantt Bar mark.

To create a Gantt chart that shows how many days elapse on average between order date and ship date, follow these steps:

  1. Connect to the Sample - Superstore data source.

  2. Drag the Order Date dimension to Columns.

    Tableau aggregates the dates by year and creates column headers with labels for the years.

  3. On the Columns shelf, click the Year (Order Date) drop-down arrow, and then select Week Number.

    The column headers change. Individual weeks are indicated by tick marks because there are 208 weeks in a four-year span – too many to show as labels in the view.

  4. Drag the Sub-Category and Ship Mode dimensions to the Rows shelf. Drop Ship Mode to the right of Sub-Category.

    This builds a two-level nested hierarchy of dimensions along the left axis.

    Next, we'll size the marks according to the length of the interval between the order date and the ship date. To do this, create a calculated field to capture that interval.

  5. In the toolbar menu, click Analysis > Create Calculated Field. You can also right-click (Control-click on Mac) any field in the Data pane and select Create > Calculated Field.

  6. In the calculation dialog box, name your calculated field OrderUntilShip.

  7. Clear any content that's in the Formula box by default.

  8. In the Formula box, enter the following formula and then click OK:

    DATEDIFF('day',[Order Date],[Ship Date])

    The formula creates a custom measure that captures the difference between the Order Date and Ship Date values, in days.

  9. Drag the OrderUntilShip measure to Size on the Marks card.

    The default aggregation for OrderUntilShip is Sum, but in this case it makes more sense to average the values.

  10. Right-click (Control-click on Mac) the SUM(OrderUntilShip) field on the Marks card, and then select Measure (Sum) > Average.

    The view is coming along. But there are too many marks squeezed into the view.

    We can make our data more readable by filtering down to a smaller time window.

  11. Hold down the Ctrl key (Option key on the Mac) and drag the Week(Order Date) field from the Columns shelf to the Filter shelf.

    By holding down the Ctrl key (or the Option key), you tell Tableau that you want to copy the field to the new location, with whatever customisations you have added, without removing it from the old location.

  12. In the Filter Field dialog box, select Range of Dates and then click Next.

  13. Set the range to a three-month time interval, such as 1/1/2013 to 3/31/2013, and then click OK.

    It can be difficult to get the exact date using the sliders – it's easier just to enter the numbers you want directly into the date boxes or use the calendar to select the dates.

  14. Drag the Ship Mode dimension to Colour on the Marks card.

    Now your view shows you all sorts of information about the lag between order times and ship times.

    For example, you can see which ship modes are more prone to longer lag times, whether lag times vary by category and whether lag times are consistent over time. 

Note: If you publish this view to Tableau Server, you can include filters that let users interact with the view by varying the time window, or filtering out various sub-categories or ship modes. For more information, see Publish Data Sources and Workbooks.

Check your work! Watch steps 1-14 below:

Note: In Tableau 2020.2 and later, the Data pane no longer shows Dimensions and Measures as labels. Fields are listed by table or folder.

Thanks for your feedback!Your feedback has been successfully submitted. Thank you!