Compartir a través de


Refresh a Graph in a Form Sample

File: ...\Samples\Solution\OLE\Stock.scx

This sample illustrates selecting data from a table and passing it to MS Graph to refresh the values in a chart. Most of the code to do this is associated with the InteractiveChange event of the cboMonth combo box.

Select the data into a cursor

SELECT date, close;
  FROM Stock1 WHERE MONTH(date) = THIS.Value ;
  ORDER BY date INTO CURSOR wtemp

Create a character string containing the selected data

SELECT wtemp

lcData = " " + TAB + "Closing Price" + CRLF

SCAN
 lcData = lcData + DTOC(date)
 lcData = lcData + TAB
 lcData = lcData + ALLTRIM(STR(close)) + CRLF
ENDSCAN

Send the character string to MS Graph

SELECT Graph
APPEND GENERAL msgraph DATA lcData

See Also

Tasks

Manipulate Display Characteristics of a Graph Sample

Reference

Graph Object Foundation Class

Other Resources

Automation Solution Samples