Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Graph object is bugging me
Message
From
11/05/1998 03:58:50
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00098433
Message ID:
00098438
Views:
30
>thanks for replying!
>
>I think i will try your solution. Currently i don't have the olebound object on a form, but that's a small change. If it works, it would be great. Still, i wonder why it fails sometimes when i do it the foxpro advisor's way.
>
>greetings
>derk
I really don't know FP advisor's way so don't know why fails.Try this one :
*!*	Below example is for MSGraph8. PEM are quite like Excel8 PEM
*!*	xlConstants can be found by :
*!*	-Open Excel
*!*	-Select tools\macro\VB editor
*!*	-Press F2 to bring up "Object browser"
*!*	-Find needed xlConstant type ie:xlChartType
*!*	-On right window click needed Constant ie: xl3DArea
*!*	-Below the window constant value is displayed
*!*	-Rather kludgy but currently the only way I know to find them

oForm = createobject("Form")
oForm.height = 400
oForm.width = 600
oForm.show

create cursor test (val1 i, val2 n(8,4) NULL, val3 n(8,4))
for ix = 1 to 90
	insert into test ;
	  values ;
	  (ix,cos(ix)*ix,sin(ix)*ix)
endfor 
45
scan next 30     && Nullify 30 degrees
	replace val2 with .null.       && Nullify some values to see effect
endscan

***
* Prepare data for MSGraph object
***
#DEFINE TAB CHR(9)
#DEFINE CRLF CHR(13)+CHR(10)
M.CGDATA = "Degree"+TAB+"Cosine"+TAB+"Sine"+CRLF
scan
    m.cgdata = m.cgdata+;
               str(nvl(val1,0))+TAB+;
               str(nvl(val2,0))+TAB+;
               str(nvl(val3,0))+CRLF
endscan
create cursor test (gen1 g)
append blank
append general gen1 class "msgraph.chart" DATA M.CGData
***
* Now we have an MSGraph object
* Play with it
***
oForm.addobject("myGraph","OleBoundControl")
oForm.addobject("myQuit1","myQuit")
with oForm.myGraph
  .height = oForm.height - 20
  .width = oForm.width 
  .left = 0
  .top = 0
  .ControlSource = "test.Gen1"
  .HasLegend = .t.
*  .autoformat(1, 1)
  .autoformat(-4098,1)  && xl3dArea
*  .autoformat(-4101, 1)  && xl3dLine
  .visible = .t.
  .object.application.plotby = 2  && Data in columns, 1 in rows - best for table data
endwith
oForm.myQuit1.visible = .t.
read events

define class myquit as commandbutton
left=1
top=1
Caption="Close"
procedure click
	clear events
endproc
enddefine
You can add a command button to change the desired cell value.
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