如何使用 OpenPyXL 将图表标题定位(对齐)到左侧
How to position (align) chart title to the left with OpenPyXL
我正在尝试将图表标题定位(对齐)到折线图的左上角。
我真的无法从文档中找到有关如何执行此操作的任何信息。
openpyxl.chart.title
有布局 属性 但我不确定那是否是要使用的 属性。
想通了。必须使用 ManualLayout
设置布局 class
from openpyxl.chart.layout import Layout, ManualLayout
man_layout = ManualLayout(xMode="edge", yMode="edge", x=0.0, y = 0.0)
line_chart.title.layout = Layout(manualLayout=man_layout)
我正在尝试将图表标题定位(对齐)到折线图的左上角。 我真的无法从文档中找到有关如何执行此操作的任何信息。
openpyxl.chart.title
有布局 属性 但我不确定那是否是要使用的 属性。
想通了。必须使用 ManualLayout
设置布局 classfrom openpyxl.chart.layout import Layout, ManualLayout
man_layout = ManualLayout(xMode="edge", yMode="edge", x=0.0, y = 0.0)
line_chart.title.layout = Layout(manualLayout=man_layout)