Extract chart setup data into seperate file, also add conditions to eventually support dc. Added error handling support.
Updated example with some more mock data