formatting for google chart api - moved calc to service