Skip to content

Commit d699004

Browse files
committed
ExcelGraphItem.title can be None
1 parent f126f13 commit d699004

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

larray/inout/xw_reporting.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def __init__(self, data, title, template, top, left, width, height):
571571
ItemSize.__init__(self, width, height)
572572
self.top = top
573573
self.left = left
574-
self.title = str(title) if title is not None else ''
574+
self.title = str(title) if title is not None else None
575575
data = aslarray(data)
576576
if not (1 <= data.ndim <= 2):
577577
raise ValueError("Expected 1D or 2D array for data argument. "
@@ -601,8 +601,9 @@ def dump(self, sheet, data_sheet, row):
601601
source = data_range(data_cells(row, 1), data_cells(last_row, last_col))
602602
obj_chart.SetSourceData(source)
603603
obj_chart.ChartType = ChartType.xlLine
604-
obj_chart.HasTitle = True
605-
obj_chart.ChartTitle.Caption = self.title
604+
if self.title is not None:
605+
obj_chart.HasTitle = True
606+
obj_chart.ChartTitle.Caption = self.title
606607
obj_chart.Legend.Position = LegendPosition.xlLegendPositionBottom
607608
if self.template is not None:
608609
obj_chart.ApplyChartTemplate(self.template)

0 commit comments

Comments
 (0)