Moved charting to separate showCharts function