refactored chart building so that I can update settings and refresh on the fly