我想将图例位置设置为“显示图例而不重叠图表”。我该怎么做呢?
我看到我可以通过以下方式设置图例位置:
from pptx.enum.chart import XL_LEGEND_POSITION
chart.has_legend = True
chart.legend.position = XL_LEGEND_POSITION.BOTTOM
根据documentation,有一个针对XL_LEGEND_POSITION的自定义选项。有没有一种方法可以使用自定义选项来指定我想要显示图例而不重叠图表?下面是用于执行此操作的Powerpoint选项的屏幕截图:"Show legend without overlapping the chart" select box
发布于 2017-02-08 18:26:01
我认为您正在寻找的是Legend
对象上的.include_in_layout
:
http://python-pptx.readthedocs.io/en/latest/api/chart.html#legend-objects
https://stackoverflow.com/questions/42120697
复制