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

Class AxisTitle

src/pptx/chart/axis.py:245–291  ·  view source on GitHub ↗

Provides properties for manipulating axis title.

Source from the content-addressed store, hash-verified

243
244
245class AxisTitle(ElementProxy):
246 """Provides properties for manipulating axis title."""
247
248 def __init__(self, title):
249 super(AxisTitle, self).__init__(title)
250 self._title = title
251
252 @lazyproperty
253 def format(self):
254 """|ChartFormat| object providing access to shape formatting.
255
256 Return the |ChartFormat| object providing shape formatting properties
257 for this axis title, such as its line color and fill.
258 """
259 return ChartFormat(self._element)
260
261 @property
262 def has_text_frame(self):
263 """Read/write Boolean specifying presence of a text frame.
264
265 Return |True| if this axis title has a text frame, and |False|
266 otherwise. Assigning |True| causes a text frame to be added if not
267 already present. Assigning |False| causes any existing text frame to
268 be removed along with any text contained in the text frame.
269 """
270 if self._title.tx_rich is None:
271 return False
272 return True
273
274 @has_text_frame.setter
275 def has_text_frame(self, value):
276 if bool(value) is True:
277 self._title.get_or_add_tx_rich()
278 else:
279 self._title._remove_tx()
280
281 @property
282 def text_frame(self):
283 """|TextFrame| instance for this axis title.
284
285 Return a |TextFrame| instance allowing read/write access to the text
286 of this axis title and its text formatting properties. Accessing this
287 property is destructive as it adds a new text frame if not already
288 present.
289 """
290 rich = self._title.get_or_add_tx_rich()
291 return TextFrame(rich, self)
292
293
294class CategoryAxis(_BaseAxis):

Callers 5

format_fixtureMethod · 0.90
has_tf_get_fixtureMethod · 0.90
has_tf_set_fixtureMethod · 0.90
text_frame_fixtureMethod · 0.90
axis_titleMethod · 0.85

Calls

no outgoing calls

Tested by 4

format_fixtureMethod · 0.72
has_tf_get_fixtureMethod · 0.72
has_tf_set_fixtureMethod · 0.72
text_frame_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…