Moved logic of building final data for chart to ModelHelper.