Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Graph in form
Message
From
22/09/1998 01:53:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
21/09/1998 18:35:11
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00139299
Message ID:
00139370
Views:
17
>hi all
>how can i (in vfp 30)get the values of trhee columns of my grid1 show a graphic
>like barr or pie in the same form wher the grid its? and refresh the
>graph when the values refresH?
>
>TNX
Augusto,
For first initialization you could do like this :
* form.init
THIS.LockScreen = .t.
#DEFINE TAB CHR(9)
#DEFINE CRLF CHR(13)+CHR(10)
		
* Data prepare *
wait window nowait "Filling cell values..."
MCGDATA = ""
nCols = fcount()
for ix = 1 to nCols
	MCGDATA = MCGDATA + iif(empty(MCGDATA),"",TAB)+field(ix)
endfor
MCGDATA = MCGDATA + CRLF
scan
 for ix = 1 to nCols
  MCGDATA = MCGDATA + iif(ix=1,"",TAB)+nvl(str(evaluate(field(ix))),"")
 endfor
 MCGDATA = MCGDATA + CRLF
endscan
* Data prepare *

create cursor foo (gen1 g)
append blank
append general gen1 class "msgraph.chart" DATA MCGData
grType = 1
GrSubtype = 1
THIS.OleBoundControl1.ControlSource = "Gen1"
THIS.OleBoundControl1.HasLegend = .t.
THIS.OleBoundControl1.autoformat(grType, GrSubtype)
THIS.LockScreen = .F.
After data is prepared once as you change data in grid all you need is to change corresponding cell in graph.datasheet.
thisform.OleBoundControl1.object.application.datasheet.cells(nRow,nCol).value = nNewValue
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform