DOCUMENT:Q259933 22-APR-2000 [foxpro] TITLE :HOWTO: Use an MSChart Control with Visual FoxPro PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:3.0,3.0b,5.0,5.0a,6.0 OPER/SYS: KEYWORDS:kbActiveX kbCtrl kbvfp300 kbvfp300b kbvfp500 kbvfp500a kbvfp600 kbGrpDSFox kbDSupport ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a, 6.0 ------------------------------------------------------------------------------- SUMMARY ======= This article demonstrates how to use an MSChart OCX control (MSCHRT20.OCX) to create a three-dimensional chart with eight columns and rows of data. This article also illustrates setting the legend parameters. MORE INFORMATION ================ The MSChart control (MSCHRT20.OCX) supports the following features: - true three-dimensional representation - support for all major chart types - data grid population through random data and data arrays The MSChart control is associated with a data grid, the DataGrid object. The DataGrid object is a table that holds the data being charted. The data grid may include labels used to identify series and categories on the chart. The data grid may be filled with information by inserting data or by importing data from a spreadsheet or array. 1. Create a program file named "MyChart.prg" (without the quotation marks) by using the following code: PUBLIC chartdemo chartdemo=CREATEOBJECT('chartdemo') chartdemo.SHOW DEFINE CLASS chartdemo AS FORM TOP = 0 LEFT = 0 HEIGHT = 250 WIDTH = 360 DOCREATE = .T. CAPTION = "MSChart Control" NAME = "Form1" ADD OBJECT olecontrol1 AS OLECONTROL WITH ; TOP = 24, ; LEFT = 42, ; HEIGHT = 181, ; WIDTH = 277, ; VISIBLE = .F., ; NAME = "Olecontrol1", ; OLECLASS="MSChart20Lib.MSChart.2" ADD OBJECT command1 AS COMMANDBUTTON WITH ; TOP = 216, ; LEFT = 24, ; HEIGHT = 24, ; WIDTH = 121, ; CAPTION = "\