Move Chart JSON stuff out into a generic helper. Still need to fix fetching correct data from row's etc...