Creating hash formatted to graph