fix broken javascript function for the charts