The Basics of Charting with the MS Chart Control (Page 1 of 4 )
MS Chart Control 6.0 (OLEDB) is the MSChart20.ocx ActiveX control that you can use in VB 6.0 for creating charts. It can graphically display data and format the various regions of the chart. Since it is not a standard control it must be added from the components collection. It is by no means an easy to use interface. This tutorial looks at some of the basic manipulations that you can do with this control. This control appears in FAQ (frequently asked questions) on many forums.
Adding the Chart Control
Start a standard Visual Basic EXE project which comes with a form. Click on the menu item Project and then click on the drop-down menu item Components and wait a few seconds. You will see the following window. Scroll down and place a check mark against this component as shown. If you also place a check mark for Selected Items Only, only this item will be shown. Click Apply and this adds an icon for this control to your tool box, which you may see in the picture that follows.

Now click on the icon (bottom right) and draw it on the form as shown. This is the default view of this control on the form. It shows five rows and each of these rows has 4 columns differentiated by their color.

All ActiveX controls have Property Pages (a collection of tabbed pages) and also a Properties Window, listing properties that can be set at design time. This control has some 50 classes, each with many methods and properties.
The next picture shows the Property Pages for this control. With this a number of properties can be set for this control by tabbing to the right page. Here you can choose the type of graph (chart), the Axes (x, y1, y2), the Series (the number of columns that you may have in your data), and so forth.

The Properties window shows the default values for the chart, displayed here. We will only examine a couple of properties and methods to get some basic understanding of how this control works.

Next: What if the Chart Control is not installed? >>
More Code Examples Articles
More By Jayaram Krishnaswamy