Sort results returned for graphs