Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Finishing Touch to Excel Graph
Below you see the code which succeeds in creating a Column Graph in Excel. I need a couple of finishing touches that I am hoping someone can provide. As it stands, the color of each of the columns is the same. I would like to set the color of each of the columns to something else. Also, I would like the columns to be a little wider. I did build a macro in excel to do this but am unable to figure out the VFP syntax that will accomplish it. Any ideas ?
oExcel = createObject("Excel.Application")
oBook = oExcel.Workbooks.Open(currentLoc()+"\techgoal.xls")
oExcel.visible = .t.
oPlotRange = oBook.Sheets[1].Range(cRange)
oChart = oBook.Charts.Add()
oChart.ChartWizard(oPlotRange)
oChart.HasLegend = .f.
oChart.HasTitle = .t.
oChart.ChartTitle.Characters.Text="SERVICE DEPARTMENT"+chr(13)+rptMonth+" Performance"+chr(13)+dtoc(dStart)+" - "+dtoc(dEnd)+chr(13)+"Print Date: "+dtoc(date())
oChart.Axes(2,1).HasTitle = .t.
oChart.Axes(2,1).AxisTitle.Characters.Text = "Percent of goal"
with oChart.Axes(2,1)
.MinimumScaleIsAuto = .t.
.MaximumScale = 100
.MinorUnitIsAuto = .t.
.MajorUnit = 10
endwith
oChart.PlotArea.Interior.ColorIndex = 2
Suivant
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