update pie chart js code