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

Method new_dLbl

src/pptx/oxml/chart/datalabel.py:76–105  ·  view source on GitHub ↗

Return a newly created "loose" `c:dLbl` element. The `c:dLbl` element contains the same (fairly extensive) default subtree added by PowerPoint when an individual data label is customized in the UI. Note that the idx value must be set by the client. Failure to set the

(cls)

Source from the content-addressed store, hash-verified

74
75 @classmethod
76 def new_dLbl(cls):
77 """Return a newly created "loose" `c:dLbl` element.
78
79 The `c:dLbl` element contains the same (fairly extensive) default
80 subtree added by PowerPoint when an individual data label is
81 customized in the UI. Note that the idx value must be set by the
82 client. Failure to set the idx value will likely result in any
83 changes not being visible and may result in a repair error on open.
84 """
85 return parse_xml(
86 "<c:dLbl %s>\n"
87 ' <c:idx val="666"/>\n'
88 " <c:spPr/>\n"
89 " <c:txPr>\n"
90 " <a:bodyPr/>\n"
91 " <a:lstStyle/>\n"
92 " <a:p>\n"
93 " <a:pPr>\n"
94 " <a:defRPr/>\n"
95 " </a:pPr>\n"
96 " </a:p>\n"
97 " </c:txPr>\n"
98 ' <c:showLegendKey val="0"/>\n'
99 ' <c:showVal val="1"/>\n'
100 ' <c:showCatName val="0"/>\n'
101 ' <c:showSerName val="0"/>\n'
102 ' <c:showPercent val="0"/>\n'
103 ' <c:showBubbleSize val="0"/>\n'
104 "</c:dLbl>" % nsdecls("c", "a")
105 )
106
107 def remove_tx_rich(self):
108 """

Callers 1

_new_dLblMethod · 0.80

Calls 2

parse_xmlFunction · 0.90
nsdeclsFunction · 0.90

Tested by

no test coverage detected