Changed js for piechart