Fixed the order of the scripts to not throw an error

Fixed an issue where the chart image was not being displayed because of script ordering.