MCPcopy Create free account
hub / github.com/scanny/python-pptx / replace_data

Method replace_data

src/pptx/chart/chart.py:159–167  ·  view source on GitHub ↗

Use the categories and series values in the |ChartData| object *chart_data* to replace those in the XML and Excel worksheet for this chart.

(self, chart_data)

Source from the content-addressed store, hash-verified

157 return _Plots(plotArea, self)
158
159 def replace_data(self, chart_data):
160 """
161 Use the categories and series values in the |ChartData| object
162 *chart_data* to replace those in the XML and Excel worksheet for this
163 chart.
164 """
165 rewriter = SeriesXmlRewriterFactory(self.chart_type, chart_data)
166 rewriter.replace_series_data(self._chartSpace)
167 self._workbook.update_from_xlsx_blob(chart_data.xlsx_blob)
168
169 @lazyproperty
170 def series(self):

Calls 3

SeriesXmlRewriterFactoryFunction · 0.90
replace_series_dataMethod · 0.80
update_from_xlsx_blobMethod · 0.80

Tested by 1