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 there will be no color for that 11th data point. I want something dynamic which should automatically pick a color by itself and plot it on the pie.
I found this link and this link, but the colors over here are not catchy and not at all good.
Can someone please brief me about how to get catchy colors in pie graph?
Thanks
You can also provide
from reportlab.lib.colors import Color
like:It's easier to manage those arguments than Hex's.
So you could provide a dynamicaly generated list of
Color
instances. You couldyield
an iterator that will generate your 'Catchy' colors. I don't think I can define your 'catchyness' for you better than your self :)I know it's kind of late to be answering, but in case someone else has the same problem, here is what worked for me:
At the start of the code you write:
You can change the color codes to get any color you like, some examples: http://www.creativecolorschemes.com/resources/free-color-schemes/beautiful-color-scheme.shtml
And when generating the pie chart you only need to add two lines at the end:
Where setItems has been previously defined as:
Use this link (last pie chart example) for extra ereference: http://m.blog.csdn.net/blog/wdt3385/10142163