Refresh a Graph in a Form Sample

JavaScript Editor js editor     Web development 



Main Page

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

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

Create a character string containing the selected data

В Copy Code
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

В Copy Code
SELECT Graph
APPEND GENERAL msgraph DATA lcData

See Also



JavaScript Editor js editor     Web development