11. 饼图
11.1 常规饼图
self.add_heading("饼图", level=1)
self.add_heading('常规饼图', level=2)
self.add_space()
# 如果需要传入个性化数据,需要改exploding_pie方法的代码
self.add_flowable(
of_ex_pie.exploding_pie(width=460, height=240)
)
self.add_caption('Exploding 饼图', category=constant.CAPTION_IMAGE)
执行代码生成饼图
11.2 嵌套Legend 饼图
self.add_heading('嵌套Legend 饼图', level=2)
self.add_space()
self.add_flowable(
# 如果需要传入个性化数据,需要改pie_with_nested_legend方法的代码
of_ex_pie.pie_with_nested_legend(
width=460, height=240
)
)
pdf.add_caption('嵌套Legend 饼图', category=constant.CAPTION_IMAGE)
执行代码生成嵌套Legend 饼图
11.4 饼图+列表
self.add_heading('饼图+列表', level=2)
self.add_space()
self.add_flowable(
# 如果需要个性化传入数据,需要改pie_with_multi_column_legend方法的代码
of_ex_pie.pie_with_multi_column_legend(width=460)
)
self.add_caption('饼图+多列', category=constant.CAPTION_IMAGE)
执行代码生成饼图加列表