update source code for pie chart