Charts and graphs: Initial cleanup up of the JavaScript code
Merge pull request #4440 from pjackson28/chartscleanup2

Charts and graphs: Initial cleanup up of the JavaScript code