SAMPLE: ChrtSmpl.exe Demonstrates Use of the Visual Basic 6.0 MSChart Control (275649)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q275649

SUMMARY

The ChrtSmpl.exe sample demonstrates how to use the Visual Basic 6.0 version of the MSChart control to graphically display numeric information. The MSChart control allows you to plot data in charts according to your specifications. To create a chart, you can set data in the control's Properties page, or you can retrieve data from an external source, such as a Microsoft Excel spreadsheet. To reference the path to the Excel workbook that contains the worksheet, use the GetObject method.

The MSChart control has many visible parts, all of which can be programmed. You can use the MSChart control's three-dimensional (3D) chart features to enhance the appearance of a report. To see these features, either set the ChartType property to a valid 3D type or set the Chart3D property to True. Note that you cannot create a 3D pie chart, because the MSChart control does not contain a ChartType property for 3D pie charts.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: August 24, 2001

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The ChrtSmpl.exe file contains the following files:

File nameSize
Project1.vbp2Kb
Form1.frm13Kb
Form1.frx9Kb
Gas.xls17Kb
Modchart.bas8Kb
Mschart.hlp296Kb
Readme.txt2Kb

NOTE: The ChartType property (VtChChartType) only has constants for the following:

ConstantDescription
VtChChartType3dBar3D Bar
VtChChartType2dBar2D Bar
VtChChartType3dLine3D Line
VtChChartType2dLine2D Line
VtChChartType3dArea3D Area
VtChChartType2dArea2D Area
VtChChartType3dStep3D Step
VtChChartType2dStep2D Step
VtChChartType3dCombination3D Combination
VtChChartType2dCombination2D Combination
VtChChartType2dPie2D Pie
VtChChartType2dXY2D XY

REFERENCES

For additional information about the MSChart control, click the article numbers below to view the articles in the Microsoft Knowledge Base:

175212 SAMPLE: CHRTSAMP.EXE Visual Basic 5.0 MSChart Sample

177997 HOWTO: Set the FillColor in the MS Chart Control at Run-time

For further information on this sample, please refer to the included Help file (Mschart.hlp).

Modification Type:MinorLast Reviewed:8/9/2004
Keywords:kbdownload kbdownload kbchart kbfile kbhowto kbSample KB275649 kbAudDeveloper