Этот код работает, но значения НЕ отображаются во встроенном графике. Что я делаю неправильно? График есть, но меток нет. Как я могу настроить отображение значений?
from pptx import Presentation
from pptx.chart.data import ChartData, CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE, XL_LEGEND_POSITION, XL_LABEL_POSITION
from pptx.util import Inches
from pptx.dml.color import RGBColor
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # blank slide
chart_data = ChartData()
chart_data.categories = ['Yes','No']
chart_data.add_series('Test', [.45,.55])
x, y, cx, cy = Inches(1), Inches(1), Inches(8), Inches(6)
chart = slide.shapes.add_chart(XL_CHART_TYPE.DOUGHNUT, x, y, cx, cy, chart_data).chart
chart.plots[0].has_data_labels = True # OK
chart.legend.position = XL_LEGEND_POSITION.BOTTOM
data_labels = chart.plots[0].data_labels
data_labels.number_format = '0.1%' # doesn't show up
data_labels.position = XL_LABEL_POSITION.OUTSIDE_END
fill = data_labels.font.fill
fill.solid()
data_labels.font.color.rgb = RGBColor(0,0,0) # not showing
prs.save('test.pptx')