从pptx文档(http://python-pptx.readthedocs.io/en/latest/user/charts.html)中,创建XY图表的代码是:
chart_data = XyChartData()
series_1 = chart_data.add_series('Model 1')
series_1.add_data_point(0.7, 2.7)
series_1.add_data_point(1.8, 3.2)
series_1.add_data_point(2.6, 0.8)
series_2 = chart_data.add_series('Model 2')
series_2.add_data_point(1.3, 3.7)
series_2.add_data_point(2.7, 2.3)
series_2.add_data_point(1.6, 1.8)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.XY_SCATTER, x, y, cx, cy, chart_data).chart
有人知道如何将系列样式更改为实线而不是标记吗?
答案 0 :(得分:1)
使用XY_SCATTER_LINES_NO_MARKERS
代替XL_CHART_TYPE.XY_SCATTER
。