Modified setChart and updateChart

Moved a lot of setChart functionality to updateChart