Update graph function and connect points sample.