Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set data labels away from chart from fixed position #1024

Open
SaiRahul-Draup opened this issue Oct 26, 2024 · 0 comments
Open

Set data labels away from chart from fixed position #1024

SaiRahul-Draup opened this issue Oct 26, 2024 · 0 comments

Comments

@SaiRahul-Draup
Copy link

SaiRahul-Draup commented Oct 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant