Put refreshChart() inside script tag