Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with excel/foxpro syntax
Message
 
À
29/12/1999 10:32:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00309795
Message ID:
00310278
Vues:
23
James,
The range is the first part passed to the chartwizard - see below.
To plot by columns change .plotby = xlRows to .plotby = 2 (which is columns) you can discover the values of the excel constants by using the object browser.
The code below will only work if you have some data in excel - try passing it with _cliptext with the values sepearted by TAB e.g.
_cliptext = "One"+TAB+"Two+CRLF+"Three"+TAB+"Four"
ox.cells(2,2).pastespecial

#DEFINE TAB CHR(9)
#DEFINE CRLF CHR(13)+CHR(10)
ox = CREATEOBJECT('excel.application')
WITH ox.activeworkbook.worksheets(1)
.ChartObjects.ADD(48,720,280,200)
.ChartObjects(2).Chart.Chartwizard(.RANGE(.cells(63,2),.cells(64,49)),xlLine,4,1,0,1,1,"","","","")
WITH .ChartObjects(2).Chart
.hastitle = .T.
.haslegend = .T.
.ChartTitle.CAPTION = "Weekday"
.ChartTitle.FONT.Underline = .T.
.ChartTitle.FONT.Size = 8
.ChartType = 63 && Set a charttype
.plotby = xlRows && Plot by 1 - rows
* Now play with chart format
WITH .Axes(xlValue)
.hastitle = .T.
WITH .AxisTitle
.CAPTION = "Average Demand kWh's"
.FONT.SIZE = 8
.FONT.Bold = .F.
.ORIENTATION = 90 && Show 90 degrees rotated - clockwise
ENDWITH
ENDWITH
WITH .Axes(xlCategory)
.hastitle = .T.
WITH .AxisTitle
.CAPTION = "Half Hours Commencing 00:00 (GMT)"
.FONT.SIZE = 8
.FONT.Bold = .F.
* .Orientation = 90 && Show 90 degrees rotated - clockwise
ENDWITH
ENDWITH
WITH .Legend
.Position = xlLegendPositionBottom
ENDWITH
WITH .SeriesCollection(1)
.NAME = "Summer"
ENDWITH
WITH .SeriesCollection(2)
.NAME = "Winter"
ENDWITH
ENDWITH
ENDWITH

Hope this helps - you should be able to fiddle with it to get the results you need.
If only everything in life was as reliable as VFP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform