Look in the help file for MSGraph for explanations
of its object model.
Also, in either Word, Excel, Access, etc. open
the Visual Basic Editor, select Tools->References,
and select "Microsoft Graph x.x Object Library".
(where x.x is the version # on your system)
After that, select View->Object Browser and select
Graph in the top combobox of the now visible Object Browser.
You'll then be able to see the full type library for MSGraph.
it did this in 99.
Its a bit of a nightmare.
You have to create a table with a general field.
Then bind the msgraph to the field, having set the parameters.
You can add a MSGraph object directly to
the form and avoid having to deal with its
UI as a separate entity.
Darrell
oForm = CREATEOBJECT("C_MSGraph2000"
oForm.SHOW()
READ EVENTS
DEFINE CLASS C_MSGraph2000 AS FORM
DOCREATE = .T.
AUTOCENTER = .T.
HEIGHT = 520
WIDTH = 593
CAPTION = "Using MSGraph 2000 plus"
*Note: Make sure to set the OleClass first
* or you'll crash VFP with a C000005!
ADD OBJECT oMsGraph AS OLECONTROL WITH ;
OLECLASS = "MSGraph.Chart.8", ;
TOP = 0, ;
LEFT = 0, ;
HEIGHT = 324, ;
WIDTH = 336, ;
NAME = "oMsGraph"
PROCEDURE INIT
WITH THIS
.oMsGraph.hasdatatable = .T.
* Get a reference to the graph's
* chart and the graph's datasheet
* via the application object of the chart
LOCAL oChart, oDataSheet
LOCAL lnGraphRow, lnGraphCol
lnGraphRow = 1
SCAN
lnGraphRow = lnGraphRow + 1
lnGraphCol = 0
FOR i = 1 TO 5
* Add the rows to the datasheet
oDataSheet.cells(lnGraphRow,lnGraphCol+i) = ;
EVAL("graphdata."+FIELD(i))
NEXT
ENDSCAN
darell,
thanks a lot with your answer.. one more question how about if i use the activex.. how do i passed my table to the data of the graph..
thanks..
DEFINE CLASS C_MSGraph2000 AS FORM
DOCREATE = .T.
AUTOCENTER = .T.
HEIGHT = 520
WIDTH = 593
CAPTION = "Using MSGraph 2000 plus"
*Note: Make sure to set the OleClass first
* or you'll crash VFP with a C000005!
ADD OBJECT oMsGraph AS OLECONTROL WITH ;
OLECLASS = "MSGraph.Chart.8", ;
TOP = 0, ;
LEFT = 0, ;
HEIGHT = 324, ;
WIDTH = 336, ;
NAME = "oMsGraph"
oChart.HasTitle = .T.
oChart.ChartTitle.TEXT = "Not quite right, but you get the idea!"+chr(13)+;
"You'll need to set the row values correctly in your table before exporting"+chr(13)+;
"Read the help file. "+chr(13)+"On my system it's :"+chr(13)+;
"C:\Program Files\Microsoft Office\Office10\1033\VBAGR10.CHM"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.