Article ID: 112650 - Last Review: January 8, 2003 - Revision: 1.1 How to Create a Gantt Chart in VB Using a Graph Custom ControlThis article was previously published under Q112650 On This PageSUMMARY
A Gantt chart is a horizontal bar chart used for project planning and
reporting. The Graph custom control that comes with the Professional
Edition of Visual Basic for Windows can be used to create a Gantt chart.
This article shows by examnple how to create a Gantt chart.
MORE INFORMATION
To create a Gantt chart using the Graph custom control, you need to know
how many bars your graph will require. Typically this includes one project
bar and several activity bars. You will also need to know the number of
sections required in each bar. Typically each bar is divided into two
sections -- one to show actual progress on the project, the other to show
plans for the time remaining. In the graph custom control, NumPoints represents the number of horizontal bars needed, so the following is true: To plot the bars on the graph, you need to assign values to the GraphData property of Graph1. GraphData values that follow ThisSet = 1 assignment indicate the beginning of the section on a bar, and the corresponding GraphData values following the ThisSet = 2 assignment, indicate the end of the section. For example: To plot the following Gantt chart:
| 5 7 11
1 | [------------]<-------------->
|
| 6 8 15
2 | [-----------]< --------------------->
|
|__________________________________________________
Graph1.ThisSet = 1 ' Beginning of intervals Graph1.GraphData = 5 Graph1.GraphData = 6 Graph1.GraphData = 7 Graph1.GraphData = 8 Graph1.ThisSet = 2 ' End of intervals Graph1.GraphData = 7 Graph1.GraphData = 8 Graph1.GraphData = 11 Graph1.GraphData = 15 Step-by-Step ExampleThis example creates the Gantt chart.
| Article Translations
|

Back to the top
