python-pptx中有图的中值函数吗?

时间:2019-03-05 21:36:15

标签: python-pptx

我想从图表中插入一个中位数,我将如何在python pptx中执行此操作?

prs = Presentation()
slide1 = prs.slides.add_slide(prs.slide_layouts[5])
title = slide1.shapes.title
title.text = "Bar Chart"


# define chart data ---------------------
chart_data = CategoryChartData()
chart_data.categories = ['2016', 'TTM']
chart_data.add_series('Chart 1', (1.4, 3.2))

# add chart to slide --------------------
x, y, cx, cy = Inches(2), Inches(2), Inches(6), Inches(4.5)
slide1.shapes.add_chart(
    XL_CHART_TYPE.COLUMN_CLUSTERED, x, y, cx, cy, chart_data
)

0 个答案:

没有答案