A quick question on your code. Do you want an XY graph, or do you want charts.
If you want an XY graph, then you need an array of the X data and an array of Y data. You then bundle those together and wire them to your graph. Take a look at the attached image.