Changed logic to request chart data when required, instead of getting data when page loads