Implemented loadChartData method to set chart data.