Drawing graphs using lineTo functiond and arrays

Hi guys and gals,

I have managed to draw a simple graph with the lineTo function pulling in data from an array.

The only problem I have is that the line joins the last data point to the first creating a closed shape instead just a ‘wiggly’ line

If anyone can help me solve this I would be eternally grateful

Best
Steve