|
Package parasol ::
Module Excel_wrapper
|
|
1 from win32com.client import Dispatch
2 from excel_const import constants
3 import string
4 import xlChFormula
5 import sys, os
6
8 '''make the input data list of lists such that each row is the same length
9 add "pad" to short rows'''
10
11 maxL = len(rs[0])
12 minL = maxL
13 for row in rs:
14 L = len(row)
15 maxL = max(maxL, L)
16 minL = min(minL, L)
17
18
19
20 if minL<maxL:
21 rs = list(rs)
22 for i,row in enumerate(rs):
23
24
25
26 rs[i] = list(row) + [pad]*(maxL-len(row))
27
28 return rs
29
30
31
32
34 numWkBooks = 0
35 - def __init__(self,xlsFile="", Visible=1):
36 self.xlApp = Dispatch("Excel.Application")
37 self.xlApp.Visible = Visible
38 ExcelWrap.numWkBooks = ExcelWrap.numWkBooks + 1
39
40
41
42 self.sheetList = []
43 self.chartList = []
44 self.chartNColumns = []
45 self.chartNRows = []
46 self.leaveOpen = 1
47 self.nRows = 0
48 self.nColumns = 0
49 self.formula = xlChFormula.xlChFormula()
50
51 if len(xlsFile)>0:
52 xlsFile = os.path.abspath(xlsFile)
53 self.xlApp.Workbooks.Open(xlsFile)
54 self.initFromXLSFile()
55 self.xlBook = None
56 else:
57 self.xlBook = self.xlApp.Workbooks.Add()
58 self.xlSheet = self.xlApp.Sheets(1)
59 self.sheetList.append( self.xlSheet )
60
62 self.xlApp.DisplayAlerts = 0
63
65 self.xlApp.DisplayAlerts = 1
66
67
69 if (__name__ != "__main__") and (not self.leaveOpen):
70
71 if self.xlApp != None: self.close()
72
74 '''get workbook sheet number from name'''
75 ns=1
76 isheet = 1
77 for i in range(1, self.xlApp.Sheets.Count+1):
78 if self.xlApp.Sheets(i).Type == constants.xlWorksheet:
79 if shtName==str(self.xlApp.Sheets(i).Name): ns = isheet
80
81 isheet += 1
82
83
84 return ns
85
87 '''get chart sheet number which uses data from sheet name'''
88 ns = 0
89 for i in range(1, self.xlApp.Sheets.Count+1):
90 try:
91 if self.xlApp.Sheets(i).Type != constants.xlWorksheet:
92
93 f = xlChFormula.xlChFormula( self.xlApp.Sheets(i).SeriesCollection(1).Formula)
94
95 if datashtName==f.labelSht: ns = i
96 except:
97 pass
98
99 return ns
100
102 '''initialize from existing XLS file.
103 (file has already been opened and assigned to self.xlApp)'''
104
105
106 self.xlSheet = None
107 self.chart = None
108
109 for ns in range(1, self.xlApp.Sheets.Count+1):
110 try:
111
112 if self.xlApp.Sheets(ns).Type == constants.xlWorksheet:
113 Ncolumns, Nrows = xlChFormula.getNcolumnsNrowsFromRange(\
114 self.xlApp.Sheets(ns).UsedRange.AddressLocal)
115
116
117 if Ncolumns>0 and Nrows>0:
118 self.xlSheet = self.xlApp.Sheets(ns)
119 self.sheetList.append( self.xlSheet )
120 self.nRows = Nrows
121 self.nColumns = Ncolumns
122
123
124 self.chartNColumns.append( self.nColumns )
125 self.chartNRows.append( self.nRows )
126
127
128 nc = self.getChartSheetNumberUsingSheetData(self.xlApp.Sheets(ns).Name)
129
130
131 if (nc>0):
132
133 self.chart = self.xlApp.Sheets(nc)
134 self.chartList.append( self.chart )
135
136
137
138 except:
139 pass
140
145
147 try:
148 r = self.xlSheet.Range(ULcell, LRcell)
149 return r.Value
150 except:
151 return ''
152
154 try:
155 r = self.xlSheet.Range(cell, cell)
156 return str( r.Value )
157 except:
158 return ''
159
163
165 if NColumn<=self.nColumns:
166
167 cL = self.formula.makeColLocation( NColumn=NColumn, NRow=1)
168 r = self.xlSheet.Range(cL, cL)
169 return str( r.Value )
170 else:
171 return 'None'
172
174 cL = self.formula.makeColLocation( NColumn=self.nColumns, NRow=1)
175 r = self.xlSheet.Range("$a$1", cL)
176 return r.Value[0]
177
178 - def addNewSeries(self, NChart=1, NSheet=1, xColumn=1, yColumn=2):
179
180
181 sh = self.sheetList[NSheet-1]
182 ch = self.chartList[NChart-1]
183 series = ch.SeriesCollection().NewSeries()
184 Ncolumns, Nrows = xlChFormula.getNcolumnsNrowsFromRange( sh.UsedRange.AddressLocal )
185 L = self.formula.makeColRange(NColumn=xColumn, fromRow=2, toRow=Nrows)
186 rx = sh.Range(L)
187 series.XValues = rx
188
189 L = self.formula.makeColRange(NColumn=yColumn, fromRow=2, toRow=Nrows)
190 ry = sh.Range(L)
191 series.Values = ry
192
193 cL = self.formula.makeColLocation( NColumn=yColumn, NRow=1)
194 r = sh.Range(cL)
195 series.Name = r
196
198
199 sh = self.xlSheet
200 ch = self.chart
201 series = ch.SeriesCollection().NewSeries()
202 Ncolumns, Nrows = xlChFormula.getNcolumnsNrowsFromRange( sh.UsedRange.AddressLocal )
203 L = self.formula.makeColRange(NColumn=xColumn, fromRow=2, toRow=Nrows)
204 rx = sh.Range(L)
205 series.XValues = rx
206
207 L = self.formula.makeColRange(NColumn=yColumn, fromRow=2, toRow=Nrows)
208 ry = sh.Range(L)
209 series.Values = ry
210
211 cL = self.formula.makeColLocation( NColumn=yColumn, NRow=1)
212 r = sh.Range(cL)
213 series.Name = r
214
215
217
218 sh = self.sheetList[NSheet-1]
219 ch = self.chartList[NChart-1]
220 Ncolumns, Nrows = xlChFormula.getNcolumnsNrowsFromRange( sh.UsedRange.AddressLocal )
221 L = self.formula.makeColRange(NColumn=xColumn, fromRow=2, toRow=Nrows)
222 rx = sh.Range(L)
223 ch.XYGroups(1).SeriesCollection(NSeries).XValues = rx
224
225 L = self.formula.makeColRange(NColumn=yColumn, fromRow=2, toRow=Nrows)
226 ry = sh.Range(L)
227 ch.XYGroups(1).SeriesCollection(NSeries).Values = ry
228
229 cL = self.formula.makeColLocation( NColumn=yColumn, NRow=1)
230 r = sh.Range(cL)
231 ch.SeriesCollection(NSeries).Name = r
232
234 if NColumn<=self.nColumns:
235 L = self.formula.makeColRange(NColumn=NColumn, fromRow=2, toRow=self.nRows)
236 r = self.xlSheet.Range(L)
237 self.chart.XYGroups(1).SeriesCollection(NSeries).XValues = r
238 self.labelXAxis( self.getAllXNames() )
239
240
241
242
243
244
246 try:
247 ns = 1
248 c = NColumn
249 if ZeroBased:c = c + 1
250 while 1:
251 L = self.formula.makeColRange(NColumn=c, fromRow=2, toRow=self.nRows)
252 r = self.xlSheet.Range(L)
253 self.chart.XYGroups(1).SeriesCollection(ns).XValues = r
254 ns = ns + 1
255 except:
256 pass
257 self.labelXAxis( self.getRowColCellValue( NColumn=c, NRow=1) )
258
260 try:
261 if NColumn<=self.nColumns:
262 L = self.formula.makeColRange(NColumn=NColumn, fromRow=2, toRow=self.nRows)
263 r = self.xlSheet.Range(L)
264 self.chart.XYGroups(1).SeriesCollection(NSeries).Values = r
265
266 cL = self.formula.makeColLocation( NColumn=NColumn, NRow=1)
267 r = self.xlSheet.Range(cL)
268 self.chart.SeriesCollection(NSeries).Name = r
269
270
271
272
273
274 except: pass
275
291
292
294 '''use cols tuple to set all plotted columns
295 if Number of Columns is wrong, correct'''
296
297 self.chart = self.xlApp.Charts.Add()
298 self.chartList.append( self.chart )
299 self.chartNColumns.append( self.nColumns )
300 self.chartNRows.append( self.nRows )
301
302 self.formatFocusedChart()
303
304 self.setAllPlottedColumns( cols=cols, ZeroBased=ZeroBased ,chartName=chartName)
305
306
308 '''use cols tuple to set all plotted columns
309 if Number of Columns is wrong, correct'''
310 if len(cols)>0: self.setNumberOfPlotCurves( len(cols) )
311 ns = 1
312 name = ''
313 for c in cols:
314 if ZeroBased:c = c + 1
315 self.changePlottedColumn(NColumn=c, NSeries=ns)
316 ns = ns + 1
317 if len(name)>0: name = name + ", "
318 name = name + str( self.getColumnName(c) )
319 self.labelPrimaryYAxis(yLabel=name)
320 self.labelXAxis( self.getColumnName(1) )
321 if len(chartName)>0: self.chart.Location(Where=1, Name=chartName)
322
324 '''use 1-based index to Sheets'''
325
326 self.xlSheet = self.sheetList[N-1]
327
328
329
330 self.xlSheet.Activate()
331
335
337 '''use 1-based index to Charts'''
338 self.xlSheet = self.sheetList[N-1]
339 self.chart = self.chartList[N-1]
340 self.nColumns = self.chartNColumns[N-1]
341 self.nRows = self.chartNRows[N-1]
342 self.chart.Activate()
343
345 self.chart.Axes( constants.xlValue, constants.xlPrimary).HasTitle = 1
346 self.chart.Axes( constants.xlValue, constants.xlPrimary).AxisTitle.Characters.Text = yLabel
347
349 xLabels = {}
350 allXNames = ''
351 try:
352 ns = 1
353 while 1:
354 self.formula.setFormula(self.chart.XYGroups(1).SeriesCollection(ns).Formula)
355 ns = ns + 1
356 xLabels[self.getCellValue( cell=self.formula.labelLoc )] = 1
357 except:
358 pass
359 for k in xLabels.keys():
360 if len(allXNames)>0:allXNames = allXNames + ', '
361 allXNames = allXNames + k
362 return allXNames
363
364
366 self.chart.Axes( constants.xlCategory, constants.xlPrimary).HasTitle = 1
367 self.chart.Axes( constants.xlCategory, constants.xlPrimary).AxisTitle.Characters.Text = xLabel
368
370 self.chart.HasTitle = 1
371 self.chart.ChartTitle.Characters.Text = title
372
374 self.chart.HasTitle = 1
375 self.chart.ChartTitle.Characters.Font.Size = pointSize
376 self.chart.ChartTitle.Characters.Font.Bold = bold
377
378
380 '''use 1-based index to Sheets'''
381 try:
382 self.chart.SeriesCollection(J).AxisGroup = constants.xlSecondary
383 if len(y2Label)>0:
384 self.chart.Axes( constants.xlValue, constants.xlSecondary).HasTitle = 1
385 self.chart.Axes( constants.xlValue, constants.xlSecondary).AxisTitle.Characters.Text = y2Label
386 except:
387 pass
388
390 '''use 1-based index to Sheets'''
391 try:
392 self.chart.SeriesCollection(J).AxisGroup = constants.xlPrimary
393 except:
394 pass
395
405
407 if style==0: s = constants.xlLineStyleNone
408 elif style==1: s = constants.xlContinuous
409 elif style==2: s = constants.xlDash
410 elif style==3: s = constants.xlDashDot
411 elif style==4: s = constants.xlDashDotDot
412 elif style==5: s = constants.xlDot
413 elif style==6: s = constants.xlDouble
414 elif style==7: s = constants.xlSlantDashDot
415 else:s = constants.xlContinuous
416
417 try:
418 self.chart.SeriesCollection(NSeries).Border.LineStyle = s
419 return 1
420 except:
421 return 0
422
424 N = 1
425 while self.setLineStyle(NSeries=N, style=style):
426 N = N + 1
427
429 t=constants.xlMedium
430 if thickness<=0:
431 return self.setLineStyle( NSeries=NSeries, style=0)
432 elif thickness==1: t=constants.xlHairline
433 elif thickness==2: t=constants.xlThin
434 elif thickness==3: t=constants.xlMedium
435 else: t=constants.xlThick
436 try:
437 self.setLineStyle( NSeries=NSeries, style=1)
438 self.chart.SeriesCollection(NSeries).Border.Weight = t
439 return 1
440 except:
441 return 0
442
444 N = 1
445 while self.setLineThickness(NSeries=N, thickness=thickness):
446 N = N + 1
447
449 try:
450 self.chart.SeriesCollection(NSeries).Border.ColorIndex = colorIndex
451 if self.chart.SeriesCollection(NSeries).MarkerStyle != constants.xlMarkerStyleNone:
452 self.chart.SeriesCollection(NSeries).MarkerBackgroundColorIndex = colorIndex
453 self.chart.SeriesCollection(NSeries).MarkerForegroundColorIndex = colorIndex
454 return 1
455 except:
456 return 0
457
459 try:
460 RevRGB= int(red) + int(green * 256) + int(blue * 65536)
461
462 self.chart.SeriesCollection(NSeries).Border.Color = RevRGB
463 if self.chart.SeriesCollection(NSeries).MarkerStyle != constants.xlMarkerStyleNone:
464 self.chart.SeriesCollection(NSeries).MarkerBackgroundColor = RevRGB
465 self.chart.SeriesCollection(NSeries).MarkerForegroundColor = RevRGB
466
467 return 1
468 except:
469 return 0
470
471
473 try:
474 self.chart.SeriesCollection(NSeries).MarkerSize = size
475 return 1
476 except:
477 return 0
478
480 N = 1
481 while self.setMarkerSize(NSeries=N, size=size):
482 N = N + 1
483
484
486 try:
487 if showPoints:
488 self.chart.SeriesCollection(NSeries).MarkerStyle = constants.xlMarkerStyleAutomatic
489 else:
490 self.chart.SeriesCollection(NSeries).MarkerStyle = constants.xlMarkerStyleNone
491 return 1
492 except:
493 return 0
494
496 N = 1
497 while self.turnMarkerOnOff(NSeries=N, showPoints=showPoints):
498 N = N + 1
499
501 if log:
502 self.chart.Axes(1).ScaleType = constants.xlLogarithmic
503
504 self.chart.Axes(1).MinorTickMark = constants.xlTickMarkCross
505 self.chart.Axes(1).HasMinorGridlines = 1
506 self.chart.Axes(1).MinorGridlines.Border.LineStyle = constants.xlDot
507 self.chart.Axes(1).MajorGridlines.Border.LineStyle = constants.xlContinuous
508 else:
509 self.chart.Axes(1).ScaleType = constants.xlScaleLinear
510
512 if log:
513 self.chart.Axes(2).ScaleType = constants.xlLogarithmic
514
515 self.chart.Axes(2).MinorTickMark = constants.xlTickMarkCross
516 self.chart.Axes(2).HasMinorGridlines = 1
517 self.chart.Axes(2).MinorGridlines.Border.LineStyle = constants.xlDot
518 self.chart.Axes(2).MajorGridlines.Border.LineStyle = constants.xlContinuous
519 else:
520 self.chart.Axes(2).ScaleType = constants.xlScaleLinear
521
523 self.chart.Axes(1).MinimumScale=xmin
524 self.chart.Axes(1).MaximumScale=xmax
525
527 self.chart.Axes(2).MinimumScale=ymin
528 self.chart.Axes(2).MaximumScale=ymax
529
530
532 self.chart.Axes(constants.xlValue, constants.xlSecondary).MinimumScale=ymin
533 self.chart.Axes(constants.xlValue, constants.xlSecondary).MaximumScale=ymax
534
535
536 - def addTextBox(self,text='comment',left=100,top=100, width=50, height=50,
537 border=3, auto=1, transparency=0.3, isBold=0, fontSize=0):
538 tb = self.chart.TextBoxes().Add(left,top,width,height)
539 tb.Text=text[:255]
540 tb.Border.Weight=border
541 if isBold:
542 tb.Font.IsBold = 1
543 if fontSize:
544 tb.Font.Size = fontSize
545 if auto:
546 tb.AutoSize=True
547 tb.Interior.Color = constants.xlColorIndexAutomatic
548
549 w = self.chart.PlotArea.Width
550 h = self.chart.PlotArea.Height
551
552 tb.Left = int( w/4)
553 tb.Top = int( h/4 )
554
555 tb.ShapeRange.Fill.Transparency = transparency
556
557
559 pRange = self.xlSheet.Range('$A$1', self.xlSheet.Cells(self.nRows, NCurves+1))
560 self.chart.SetSourceData( pRange, constants.xlColumns )
561
562 - def makeChart(self, rs, title="Data From Python", nCurves = 1,
563 sheetName="",chartName="", showPoints=1, showLegend=1,
564 yLabel="Vertical Axis", xLabel="Horizontal Axis"):
565 '''make Excel Chart from rs
566 rs is a tuple of tuples, or a list of lists
567 Top row of titles, then rows of data'''
568 if len(self.chartList)>0:
569 self.xlSheet = self.xlApp.Sheets.Add()
570 self.sheetList.append( self.xlSheet )
571 if len(sheetName)>0:self.xlSheet.Name = sheetName
572
573 rs = squareUpRS( rs, pad='' )
574
575 self.nRows = len(rs)
576 self.nColumns = len(rs[0])
577 cRange = self.xlSheet.Range('$A$1', self.xlSheet.Cells(self.nRows, self.nColumns))
578 cRange.Value = rs
579
580 self.chart = self.xlApp.Charts.Add()
581 self.chartList.append( self.chart )
582 self.chartNColumns.append( self.nColumns )
583 self.chartNRows.append( self.nRows )
584 if len(chartName)>0: self.chart.Location(Where=1, Name=chartName)
585
586 self.chart.ChartType = constants.xlXYScatterLines
587 self.chart.SizeWithWindow = 1
588
589 if self.nColumns>nCurves+1:
590 pRange = self.xlSheet.Range('$A$1', self.xlSheet.Cells(self.nRows, nCurves+1))
591 else:
592 pRange = cRange
593 self.chart.SetSourceData( pRange, constants.xlColumns )
594 self.chart.PlotArea.Interior.ColorIndex = constants.xlNone
595
596 self.chart.HasTitle = 1
597 self.chart.ChartTitle.Characters.Text = title
598
599 if len(xLabel)>0:
600 self.chart.Axes( constants.xlCategory, constants.xlPrimary).HasTitle = 1
601 self.chart.Axes( constants.xlCategory, constants.xlPrimary).AxisTitle.Characters.Text = xLabel
602
603 if len(yLabel)>0:
604 self.chart.Axes( constants.xlValue, constants.xlPrimary).HasTitle = 1
605 self.chart.Axes( constants.xlValue, constants.xlPrimary).AxisTitle.Characters.Text = yLabel
606
607 self.chart.Axes(1).HasMajorGridlines = 1
608 self.chart.Axes(1).MajorGridlines.Border.LineStyle = constants.xlDot
609 self.chart.Axes(2).MajorGridlines.Border.LineStyle = constants.xlDot
610
611 if not showPoints: self.turnMarkersOnOff(showPoints=0)
612 if not showLegend: self.chart.HasLegend = 0
613
614 - def makeDataSheet(self, rs, sheetName="DataSheet", autoFit=1, rowFormatL=None,
615 textFont='', textFontSize=None):
616 '''make Excel Data Sheet from rs
617 rs is a tuple of tuples, or a list of lists
618 Top row of titles, then rows of data'''
619 self.xlSheet = self.xlApp.Sheets.Add()
620 self.sheetList.append( self.xlSheet )
621 if len(sheetName)>0:self.xlSheet.Name = sheetName
622
623 rs = squareUpRS( rs, pad='' )
624
625
626 self.nRows = len(rs)
627 self.nColumns = len(rs[0])
628
629
630 for i in range( self.nRows ):
631 for j in range( self.nColumns ):
632 try:
633 if rs[i][j][0]=='=':
634 rs[i][j] = "'" + str(rs[i][j])
635 except:
636 pass
637
638
639 cRange = self.xlSheet.Range('$A$1', self.xlSheet.Cells(self.nRows, self.nColumns))
640 cRange.Value = rs
641
642 if textFont:
643 cRange.Font.Name = textFont
644
645 if textFontSize:
646 cRange.Font.Size = textFontSize
647
648 if autoFit:
649 cRange.Columns.AutoFit()
650
651
652 if rowFormatL:
653 for i,rowFormat in enumerate( rowFormatL ):
654 if rowFormat:
655 N = i+1
656 cLR = self.formula.makeColLocation( NColumn=self.nColumns, NRow=N)
657 rowRange = self.xlSheet.Range('$A$%i'%N, cLR)
658 rowRange.NumberFormat = rowFormat
659
660
661
663 '''add to Excel Data Sheet from rs
664 rs is a tuple of tuples, or a list of lists
665 Top row of titles, then rows of data'''
666 self.focusSheetByName(shtName=sheetName)
667
668 rs = squareUpRS( rs, pad='' )
669
670 ucol, urow = xlChFormula.getNcolNrow( cell=upperLeft)
671 lcol = len(rs[0]) + ucol - 1
672 lrow = len(rs) + urow - 1
673
674 cLR = self.formula.makeColLocation( NColumn=lcol, NRow=lrow)
675
676
677
678 cRange = self.xlSheet.Range(upperLeft, cLR)
679 cRange.Value = rs
680
681
683 '''add to Excel Data Sheet from rs
684 rs is a tuple of tuples, or a list of lists
685 Top row of titles, then rows of data'''
686
687 rs = squareUpRS( rs, pad='' )
688
689 ucol, urow = xlChFormula.getNcolNrow( cell=upperLeft)
690 lcol = len(rs[0]) + ucol - 1
691 lrow = len(rs) + urow - 1
692
693 cLR = self.formula.makeColLocation( NColumn=lcol, NRow=lrow)
694
695
696
697 cRange = self.xlSheet.Range(upperLeft, cLR)
698 cRange.Value = rs
699
700
701 - def pageSetupForSheet(self, landscape=0, fitWidth=0, fitHeight=0, marginInches=0.0):
702 '''use active sheet'''
703
704
705 if fitWidth:
706 self.xlSheet.PageSetup.FitToPagesWide = fitWidth
707 if fitHeight:
708 self.xlSheet.PageSetup.FitToPagesTall = fitHeight
709
710 if landscape:
711 self.xlSheet.PageSetup.Orientation = constants.xlLandscape
712 else:
713 self.xlSheet.PageSetup.Orientation = constants.xlPortrait
714 self.xlSheet.PageSetup.Zoom = False
715
716 if marginInches > 0.0:
717 self.xlSheet.PageSetup.LeftMargin = self.xlApp.InchesToPoints(marginInches)
718 self.xlSheet.PageSetup.RightMargin = self.xlApp.InchesToPoints(marginInches)
719 self.xlSheet.PageSetup.TopMargin = self.xlApp.InchesToPoints(marginInches)
720 self.xlSheet.PageSetup.BottomMargin = self.xlApp.InchesToPoints(marginInches)
721
722
723 if __name__ == "__main__":
724 xl = ExcelWrap()
725 rs = ( ("x", "y", "Zee","Queue"), (1,1,1,1,1,1), (2,2,3,4), (3,3,5,8) )
726 rs = squareUpRS( rs, pad='xxx' )
727
728 xl.makeChart(rs, title="Now is the time for First Things",nCurves = 3,
729 chartName="First Chart",
730 sheetName="First Dataset",
731 yLabel="Vertical Axis", xLabel="Horizontal Axis")
732 rs = ( ("A", "B", "Cee", "Dee"), (11,33,33,33), (21,21,25,30), (31,11,21,25) )
733 xl.makeChart(rs, title="This is a Second Plot",nCurves = 3,
734 chartName="Second Chart", showPoints=0, showLegend=0,
735 sheetName="Second Dataset",
736 yLabel="Vertical Axis", xLabel="Horizontal Axis")
737 xl.focusChart(1)
738 xl.putSeriesOnSecondary(1, y2Label="Second Y Axis")
739 xl.putSeriesOnSecondary(2)
740 xl.putSeriesOnPrimary(1)
741 xl.labelXAxis("Whole New X Axis Label")
742 xl.labelPrimaryYAxis("Whole New Y Axis Label")
743 xl.setLineThickness(NSeries=1, thickness=1)
744 xl.setLineThickness(NSeries=2, thickness=2)
745 xl.setLineThickness(NSeries=3, thickness=3)
746 xl.setMarkerSize( NSeries=1, size=4)
747 xl.setMarkerSize( NSeries=2, size=6)
748 xl.setMarkerSize( NSeries=3, size=8)
749 xl.xlApp.DisplayAlerts = 0
750 xl.setLineStyle(NSeries=1, style=0)
751
752 xl.setSeriesColorIndex(NSeries=1, colorIndex=1)
753
754 xl.setSeriesColor( NSeries=2, red=0, green=255, blue=0)
755 xl.setSeriesColor( NSeries=3, red=255, green=0, blue=0)
756 text='''abcdefghijklmnopqrstuvwxy
757 abcdefghijklmnopqrstuvwxy
758 abcdefghijklmnopqrstuvwxy
759 abcdefghijklmnopqrstuvwxy
760 abcdefghijklmnopqrstuvwxy
761 abcdefghijklmnopqrstuvwxy
762 abcdefghijklmnopqrstuvwxy
763 abcdefghijklmnopqrstuvwxy
764 abcdefghijklmnopqrstuvwxy
765 abcdefghijklmnopqrstuvwxy
766 abcdefghijklmnopqrstuvwxy
767 abcdefghijklmnopqrstuvwxy'''
768 xl.addTextBox(text=text)
769 xl.setXrange( 1.0, 3.0)
770 xl.setYrange( 1.0, 5.0)
771