graph is set to take data and draw