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

Class CT_NumDataSource

src/pptx/oxml/chart/series.py:77–103  ·  view source on GitHub ↗

`` `` custom element class used in XY and bubble charts, and perhaps others.

Source from the content-addressed store, hash-verified

75
76
77class CT_NumDataSource(BaseOxmlElement):
78 """
79 ``<c:yVal>`` custom element class used in XY and bubble charts, and
80 perhaps others.
81 """
82
83 numRef = OneAndOnlyOne("c:numRef")
84
85 @property
86 def ptCount_val(self):
87 """
88 Return the value of `./c:numRef/c:numCache/c:ptCount/@val`,
89 specifying how many `c:pt` elements are in this numeric data cache.
90 Returns 0 if no `c:ptCount` element is present, as this is the least
91 disruptive way to degrade when no cached point data is available.
92 This situation is not expected, but is valid according to the schema.
93 """
94 results = self.xpath(".//c:ptCount/@val")
95 return int(results[0]) if results else 0
96
97 def pt_v(self, idx):
98 """
99 Return the Y value for data point *idx* in this cache, or None if no
100 value is present for that data point.
101 """
102 results = self.xpath(".//c:pt[@idx=%d]" % idx)
103 return results[0].value if results else None
104
105
106class CT_SeriesComposite(BaseOxmlElement):

Callers

nothing calls this directly

Calls 1

OneAndOnlyOneClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…