Update the graph after adding new values

Because adding new values can increase the newPointer variable