moving google charts logic to chart service