Generar y exportar gráfico con el MSGraph
Visual Fox Pro, Trucos Comentarios ( 0 ) »oGraf = Createobject("MSGraph.Chart.8")
ds = oGraf.Application.DataSheet
ds.Cells.Clear
oGraf.Width = 500
oGraf.Height = 500
ds.Cells(1,2).Value=
"Maria"
ds.Cells(2,2).Value= "11,20"
ds.Cells(1,3).Value= "José"
ds.Cells(2,3).Value= "15"
ds.Cells(1,4).Value= "Ana"
ds.Cells(2,4).Value
= "17"
ds.Cells(1,5).Value= "Patricia"
ds.Cells(2,5).Value= "19"
ds.Cells(1,6).Value= "Carlos"
ds.Cells(2,6).Value= "20"
ds.Cells(1,7).Value
= "Sofia"
ds.Cells(2,7).Value= "22"
With oGraf
.ChartType = -4102
.HasLegend = .T.
.HasTitle = .F.
.Legend.Font.Size
= 8
.Legend.AutoScaleFont = .T.
.ApplyDataLabels
.SeriesCollection(1).DataLabels.AutoScaleFont = .T.
.SeriesCollection(1).DataLabels.Font.Size= 8
.SeriesCollection(1).Interior.ColorIndex = 36
.ChartArea.Interior.ColorIndex = 2
.PlotArea.Width= 200
.PlotArea.Height= 200
EndWith
cFile = "c:Graf.jpg"
oGraf.Export(cFile,"JPEG")
=Messagebox("El archivo fue exportado a " + cFile)
