Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Plot an OLE graph in a VFP form ( Help... )
Message
From
23/05/2001 05:40:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/05/2001 23:44:08
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00510192
Message ID:
00510230
Views:
19
This message has been marked as the solution to the initial question of the thread.
>How can I Plot an OLE graph in a VFP form ?
>
>I created a chart and saved it in a General field
>
>Later the user wants to change the way the graph is PLOTED
>from Row to Column in a form just selecting an option
>button of the form.
>
>THISFORM.oGrafico is an OLE bound control of the form where I show the chart.
>
>I think to Plot a graph in a VFP form the way is using the SetSourceData method,
>but it doesnt work.
>
>THISFORM.oGrafico.SetSourceData(THISFORM.oGrafico.ActiveSheet.Range("A1:A154"),2)
>
>But it returns this: Member ACTIVESHEET does not evaluate to an object.
>
>If I try this:
>
>THISFORM.oGrafico.SetSourceData(THISFORM.oGrafico.Sheet("Plan1").Range("A1:A154"),2)
>
>it return this: Member SHEET does not evaluate to an object.
>
>Question:
>Which is the name, or how can I get the object of the sheet from a OLE graph in a VFP form
>to execute the SetSourceData method ?
>Or is there another way to plot the graph
>
>Please, I need Help....
>
>Thanks In Advance.

Peter,
SetSourceData AFAIK not exists in Graph Activex but Excel. Here I assume you mean ActiveX MSGraph control.
For PlotBy changing use :
THISFORM.oGrafico.object.Application.Plotby = 2 && Or one for rows

It doesn't have an ActiveSheet too but just one datasheet. To acces and change values use :
THISFORM.oGrafico.object.Application.DataSheet ie:
with THISFORM.oGrafico.object.Application.DataSheet
  * Replace C14-C24 with A1-A10 * 2 
  for ix = 10 to 20
   .Range('A5:A20').Cells(ix,3).Value = ;
   .Range('A1:B10').Cells(ix,1).Value * 2 
  endfor
  * Set B25-E35 to 100
  .Range('B25:E35').Cells.Value = 100
  * Clear values from A1-B30
  .Range('A1:B30').Cells.Clear
endwith
In the above note that if initial datasheet didn't have columns B-E that would be created and added to legend.
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
Next
Reply
Map
View

Click here to load this message in the networking platform