generate graph