Gantt Diagram

  • 3 minutes to read

This document details the specifics of the Gantt diagram type. It lists the series view types associated with this diagram type, demonstrates how its specific options can be accessed (both at design and runtime), and briefly describes these options. Before reading this text, you may wish to review the basics of using diagram in the WinForms Chart Control.

This document consists of the following sections.

Associated Series View Types

The Gantt diagram is used to plot series of the Side-by-Side and Overlapped Gantt view types. These views display horizontal bars along the date-time axis. Each bar represents a separate event with start and end values, so these charts are used to track different activities during the time frame (e.g. plan the use of various resources, review the project's completion in project management, etc.). This chart type is useful when it's necessary to show activity bars from different series one above another, to compare their duration. You can freely combine series of these view types within the same diagram.

A typical example of the Gantt diagram is shown in the following image.



Since it's common for Gantt charts to show the date-time axis (axis of values) horizontally, the Gantt chart cannot be rotated. Therefore, the GanttDiagram.Rotated property for the GanttDiagram is hidden and unavailable.

To learn how to access the Gantt diagram and its options, refer to the next section of this document.

Accessing a Diagram

To access the Gantt diagram's options at design time, click your chart, to select it. Then, in the Properties window, expand the ChartControl.Diagram property.


At runtime, cast your instance of the Diagram object to the GanttDiagram type.

// Cast Diagram to the GanttDiagram type.
GanttDiagram diagram = chart.Diagram as GanttDiagram;
if (diagram != null) {
    // Access the diagram's options. 
    diagram.EnableAxisXScrolling = true;
    diagram.EnableAxisYScrolling = true;

Specific Options

Since the GanttDiagram class is derived from the XYDiagram class, its set of properties is similar to the properties of the XY-Diagram. The only difference is that the GanttDiagram.Rotated property is hidden, and its value is always equal to true.

So, taking this sole difference into consideration, you can refer to the list of available options in the following document: XY-Diagram.

See Also