Added JavaScript chart function.