Skip to content

Set data labels away from chart from fixed position #1024

@SaiRahul-Draup

Description

@SaiRahul-Draup

I am using a doughnut chart in python-pptx; I want to set the datalabels to br away from the chart (exactly 2 inches) as datalabel position is not sufficient, I am lloking for other alternatives:

for idx, point in enumerate(chart.series[0].points):
dl = point.data_label
dl.text_frame.text = f"{chart_data.categories[idx].label}"
dl.show_leader_line = true
for para in dl.text_frame.paragraphs:
for rune in para.runs:
rune.font.size = Pt(int(shape_filled_text_ls[1])
#set this datalabel 2 inches away from chart center so that leader lines are visible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions