Python-Pie chart in reportlabs

前端 未结 2 1305
粉色の甜心
粉色の甜心 2021-01-24 19:17

I\'m referring this link for generation of Pie Chart. In this the colors are pre-defined for each data, ie 10 colors for 10 data points. What if I have 11 data points and then t

2条回答
  •  终归单人心
    2021-01-24 20:13

    You can also provide from reportlab.lib.colors import Color like:

    Color(red=0, green=0, blue=1, alpha=1) # gives blue
    Color(red=1, green=0, blue=0, alpha=1) # gives red
    

    It's easier to manage those arguments than Hex's.
    So you could provide a dynamicaly generated list of Color instances. You could yield an iterator that will generate your 'Catchy' colors. I don't think I can define your 'catchyness' for you better than your self :)

提交回复
热议问题