Finally refactored chart into external JS file. At the moment, it's not showing up in Chrome, however. Adding label soon.