@@ -151,7 +151,7 @@ def graphs_per_row(self):
151
151
152
152
See Also
153
153
--------
154
- :py:obj:``~AbstractSheetReport .newline`
154
+ ReportSheet .newline
155
155
"""
156
156
return self ._graphs_per_row
157
157
@@ -273,6 +273,9 @@ def add_graph(self, data, title=None, template=None, width=None, height=None):
273
273
def add_graphs (self , array_per_title , axis_per_loop_variable , template = None , width = None , height = None ,
274
274
graphs_per_row = 1 ):
275
275
r"""
276
+ Add multiple graph items to the current sheet. This method is mainly useful when multiple
277
+ graphs are generated by iterating over one or several axes of an array (see examples below).
278
+ The report Excel file is generated only when the :py:obj:`~ExcelReport.to_excel` is called.
276
279
277
280
Parameters
278
281
----------
@@ -303,6 +306,8 @@ def add_graphs(self, array_per_title, axis_per_loop_variable, template=None, wid
303
306
>>> sheet_pop = report.new_sheet('Population')
304
307
>>> pop = demo.pop
305
308
309
+ Generate a new graph for each combination of gender and year
310
+
306
311
>>> sheet_pop.add_graphs({'Population of {gender} by country for the year {year}': pop},
307
312
... {'gender': pop.gender, 'year': pop.time},
308
313
... template='line', width=450, height=250, graphs_per_row=2)
@@ -395,7 +400,7 @@ class AbstractExcelReport(AbstractReportItem):
395
400
396
401
>>> sheet_countries.newline()
397
402
398
- Add multiple graphs at once
403
+ Add multiple graphs at once (add a new graph for each combination of gender and year)
399
404
400
405
>>> sheet_countries.add_graphs({'Population of {gender} by country for the year {year}': pop},
401
406
... {'gender': pop.gender, 'year': pop.time},
0 commit comments