Update graph directly in addData function