First working version of pie charts generation