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

Method replace_series_data

src/pptx/chart/xmlwriter.py:216–230  ·  view source on GitHub ↗

Rewrite the series data under *chartSpace* using the chart data contents. All series-level formatting is left undisturbed. If the chart data contains fewer series than *chartSpace*, the extra series in *chartSpace* are deleted. If *chart_data* contains more s

(self, chartSpace)

Source from the content-addressed store, hash-verified

214 self._chart_data = chart_data
215
216 def replace_series_data(self, chartSpace):
217 """
218 Rewrite the series data under *chartSpace* using the chart data
219 contents. All series-level formatting is left undisturbed. If
220 the chart data contains fewer series than *chartSpace*, the extra
221 series in *chartSpace* are deleted. If *chart_data* contains more
222 series than the *chartSpace* element, new series are added to the
223 last plot in the chart and series formatting is "cloned" from the
224 last series in that plot.
225 """
226 plotArea, date_1904 = chartSpace.plotArea, chartSpace.date_1904
227 chart_data = self._chart_data
228 self._adjust_ser_count(plotArea, len(chart_data))
229 for ser, series_data in zip(plotArea.sers, chart_data):
230 self._rewrite_ser_data(ser, series_data, date_1904)
231
232 def _add_cloned_sers(self, plotArea, count):
233 """

Callers 2

replace_dataMethod · 0.80

Calls 2

_adjust_ser_countMethod · 0.95
_rewrite_ser_dataMethod · 0.95

Tested by 1