update js for chart