sort compare data for graph