Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sample of MS Graph? VFP5/6
Message
De
22/09/1999 06:36:08
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
21/09/1999 12:39:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00267187
Message ID:
00267490
Vues:
17
Jeff,

As Cetin mentioned, drive Excel via OLE automation.

Go in Excel. Start recording a macro. Do some graphing tasks. Stop the macro and read what you get (Edit macro). Then you can practically paste the macro into Fox. Works great for any Excel task.

I recorded this:

' Macro1 Macro
' Macro recorded 9/22/99 by Cindy Winegarden
'

'
Charts.Add
ActiveChart.ChartType = xl3DColumn
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:C4"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "My graph"
.Axes(xlCategory).HasTitle = True
.Axes(xlCategory).AxisTitle.Characters.Text = "years"
.Axes(xlSeries).HasTitle = True
.Axes(xlSeries).AxisTitle.Characters.Text = "time"
.Axes(xlValue).HasTitle = True
.Axes(xlValue).AxisTitle.Characters.Text = "amount"
End With
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.InvertIfNegative = False
Selection.Fill.OneColorGradient Style:=msoGradientFromCenter, Variant:=1, _
Degree:=0.380392156862745
With Selection
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 29
End With
End Sub



>Does anyone have a sample of using an MS Graph object embedded in a form -- especially how to set its datasheet from a cursor or array, and how to change graph types on the fly?
>
>I want this graph to be part of a bigger form, not its own thing.
>
>Help is as always, gratefully accepted.
>
>The sample in VFP6 help is woefully underdocumented, and the GRAPH object is useless; it only calls a wizard to build a GRAPH OLE object, but without showing how to do it.
>
>-- jas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform