Graph template now retrieving from database