Форум сайта python.su
Привет!
Я использую библиотеку python-pptx для создания презентаций, разбираю пример:
http://python-pptx.readthedocs.org/en/latest/user/charts.html
для круговой диаграммы:
chart_data = ChartData() chart_data.categories = ['West', 'East', 'North', 'South', 'Other'] chart_data.add_series('Series 1', (0.135, 0.324, 0.180, 0.235, 0.126)) chart = slide.shapes.add_chart( XL_CHART_TYPE.PIE, x, y, cx, cy, chart_data ).chart chart.has_legend = True chart.legend.position = XL_LEGEND_POSITION.BOTTOM chart.legend.include_in_layout = False chart.plots[0].has_data_labels = True data_labels = chart.plots[0].data_labels data_labels.number_format = '0%' data_labels.position = XL_LABEL_POSITION.OUTSIDE_END
Офлайн