Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to display a graph on as form
Message
From
03/10/2006 08:14:28
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
 
To
03/10/2006 04:31:52
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01158784
Message ID:
01158820
Views:
21
>I can build a form with an olebject referring to msChart20 but i don't know how to manage it.

It's so easy.
I adapted my codes as a sample.
taken your oleobject name as "graph":
#DEFINE crlf		CHR(13)+CHR(10)
#DEFINE tab 		CHR(9)

	CREATE CURSOR graph (graph g)
	APPEND BLANK
	nomsgraph=.f.
	ON ERROR nomsgraph=.t.
	APPEND GENERAL graph CLASS "msgraph.chart"
	 ON ERROR 
	 IF nomsgraph
            messagebox("no ms-graph found!..")
	         RETURN .f.
	 ENDIF 
	
cdata=""

SELECT sales

  SCAN
     cdata=m.cdata+tab+month_name
  ENDSCAN 
     cdata=cdata+crlf+"Month"

  SCAN 
     cdata=cdata+tab+trans(amount)
  ENDSCAN 

     SELECT graph 
    APPEND GENERAL graph DATA m.cData
	thisform.graph.ControlSource="graph.graph"


thisform.graph.hastitle=.t.
thisform.graph.ChartTitle.Caption=" Sales "

*thisform.graph.Legend.Shadow=.t.
Note: Maybe I did some syntax mistakes when summarising... Should be care for mistakes...
Previous
Reply
Map
View

Click here to load this message in the networking platform