Information générale
Catégorie:
Contrôles ActiveX en VFP
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement