Generate graph