Moved javascript code to static/charts.js