The information in this article applies to:
SUMMARYThe GraphWizard is a FoxPro application named GENGRAPH.APP. The UPDATEGRPH procedure updates a graph that was created and saved with the GraphWizard using the data in the currently selected DBF/cursor. The updated graph can then be displayed using the SHOWGRPH procedure.
MORE INFORMATIONIn version 2.5, the correct syntax for calling UPDATEGRPH is:
The clauses that are used with the UPDATEGRPH procedure in version 2.5 are <expC1> and <expN1> and two optional clauses: <expN2> and <expC2>.
In versions 2.5a and 2.5b, the correct syntax for calling UPDATEGRPH is:
The clauses that are used with the UPDATEGRPH procedure in versions 2.5a and 2.5b are <expC1> and <expN1> and four optional clauses: <expN2>, <expC2>, <array>, and <expC3>.
When mode = 0, UPDATEGRPH converts the currently selected DBF/cursor into the format that Microsoft Graph requires and inserts the data in the previously saved graph (the new data replaces the previous data). The graph data will match the DBF/table structure. For example, if a MODIFY GENERAL window is double-clicked to bring up MS Graph itself, a spreadsheet- like array of data will appear. If UPDATEGRPH is called with mode = 0, this spreadsheet mirrors the structure of the DBF/cursor that is open in the current work area. DO UPDATEGRPH IN GENGRAPH.APP WITH ; "c:\foxprow\qrygraph.dbf",4,0,"Graph Title" When mode = 1 (the default if no mode is specified), UPDATEGRPH updates the previously saved graph with data from the currently selected DBF/table. In this mode, UPDATEGRPH and REFRESHGRPH do essentially the same thing. The previously saved field names, order of data, x-axis field, and graph title are used to format the new data in the saved graph. DO UPDATEGRPH IN GENGRAPH.APP WITH "c:\foxprow\qrygraph.dbf",4 In versions 2.5a and 2.5b, when mode = 2, you must supply <array> and <expC3> to UPDATEGRPH, which will use them to format the data found in the currently selected DBF/cursor. Mode 2 provides the most flexibility but requires the most work to set up. You would use this mode if the DBF/cursor fields were not already ordered in the sequence that the graph requires, or if only a few of the fields found in the DBF/cursor are to be included in the graph.
For example, suppose you used the GraphWizard to create a line chart, then customized the chart from within MS Graph (changing fonts, repositioning the legend, modifying colors, and so forth). Furthermore, suppose that the graph contains sales data from a field named "Sales". The x-axis labels are month names from a "Months" field. You save the customized graph in a DBF/table called QRYGRAPH.DBF. QRYGRAPH.DBF already has other seven other graphs in it--the new graph is saved in record number 8. Later, you want to reuse the same carefully customized graph to display data from completely different fields, perhaps "Expenses" and "Years" instead of "Sales" and "Months". You can use the UPDATEGRPH procedure to make such changes to the original graph. For example:
DIMENSION g_flist[1] g_flist[1] = "Expenses" g_xaxis = "Years" DO updategrph IN gengraph.app WITH "qrygraph.dbf", 8, 2, ; "Expenses by Year", g_flist, g_xaxis This command updates the stored graph in record 8 of QRYGRAPH.DBF. The new graph title is "Expenses by Year". The first column of data -- the data shown in the MS Graph spreadsheet if a graph was double-clicked -- comes from the DBF/cursor field "Expenses". The x-axis labels are drawn from the values stored in the DBF/cursor field named "Years". Keywords : kbcode FxinteropSpread Version : 2.50 2.50a 2.50b | 2.50b Platform : MACINTOSH WINDOWS Issue type : |
Last Reviewed: August 20, 1999 |