Gantt charts are traditionally used for visualizing project schedules. They are effective for illustrating task durations and dependencies in context of the larger business operation. As with several visualizations that can be built with Tableau, the fact that ‘Gantt Bar’ is a mark type option unlocks some flexibility that allows you to use this chart type in many other ways. To start demonstrating the usefulness of the Gantt Bar mark type, we will build a Gantt chart with a traditional application of illustrating project schedules. The final product will look like this:
This is one of the few examples that cannot be illustrated using the Sample – Superstore data source, so we will be using the following data set:
For the purposes of this illustration, let’s pretend that we are a manager with three employees and we are plotting out their schedules across twelve projects for the year. We have created the schedules in Excel, but want to leverage data visualization to (1) get a better sense of how our projects and employees line up, (2) track progress to completion for each project, and (3) provide a visual schedule for our employees to use. All three of these features can be provided through a Gantt chart.
Gantt charts are created with one date, one or more dimensions, and zero to two measures. The date provides the axis; the dimensions provide the breakdowns we want to visualize and/or the encoding of the Gantt bars; the measures create the length of the Gantt bars and/or their encoding.
For this Gantt chart, we would like to have a continuous axis running left to right, so we will put the Date dimension (being used as a continuous field) on the Columns Shelf. Looking at the final product above, there are rows for each combination of Project and Person, which tells us those breakdowns reside on the Rows Shelf. Gantt chart is the default mark type in Tableau for this combination of dimensions and measures, so placing the fields on the view results in this foundation of a Gantt chart:
What Tableau has done is place a Gantt mark at the start date of each combination of Project and Person. To extend the Gantt bars to illustrate task duration, we need to size each mark by the number of days in each respective project / person combination. You may have a field for duration in the underlying data set, but it can also be created in Tableau with a calculated field. In this case, duration simply equals [End Date] – [Start Date]
Placing the duration on the Size Marks Card will extend the Gantt marks so that project / person combinations with longer durations will be longer bars and project / person combinations with shorter durations will be shorter bars.
At this point, we have a usable Gantt chart, but there is still room to add a lot of value in Tableau through formatting, encoding, and reference lines. This step is flexible based on your own requirements, but as just one example, we have done the following:
Here is our final Gantt chart after making these changes and cleaning up the formatting:
In the next post, we will illustrate one special use of the Gantt mark type: Waterfall Charts.
Not sure on your next step? We'd love to hear about your business challenges. No pitch. No strings attached.