使用xlsxwri计算相对位置

2024-05-29 05:59:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我指的是this link在每个饼图下面绘制饼图和条形图。在

我的数据是动态的,这意味着我可以有1个饼图+条形图或多个,这取决于我收到的数据。在

在提供的链接中,位置是硬编码的,即一个饼图位于C2,另一个饼图位于C18。我不想硬编码它,而是提供一个动态值,应该放置下一个饼图后留下2-3行。在

在使用reportlabs生成PDF时,我使用showPage()从下一页开始。xlsxwriter中有类似的内容吗?在


Tags: 数据内容编码pdf链接绘制link动态
1条回答
网友
1楼 · 发布于 2024-05-29 05:59:14

In the link provided, the placement of location is hardcoded, ie one pie chart at C2 and the other at C18. I dont want to hardcode it rather provide a dynamic value which should place the next pie chart after leaving 2-3 lines.

与大多数XlsxWriter方法一样,^{}接受(row, column) notation as wll as "A1" notation。因此,您可以将achart定位为以下位置:

worksheet.insert_chart(3, 4, chart)

如果要将多个图表放在彼此靠近的位置,则可以执行以下操作:

^{pr2}$

您还可以使用链接到的示例中显示的offset选项在单元格中定位图表。在

有关详细信息,请参阅Chart APIWorking with Charts文档。在

While using reportlabs to generate PDF, I used showPage() to start from the next page. Is there anything like this in xlsxwriter?

可以使用^{}方法在工作表中设置分页符。在

相关问题 更多 >

    热门问题