I have a set of data that I would like to plot as a line graph: x vs y. My data consists of one array for the x axis points and another same-sized array for the corresponding y values at each x axis point. This should make one line. How do I plot this in MSchart? I am using the follwing code I pulled from a search on this forum, but it wants to plot it as two series of data rather than one vs. the other. Thanks.
Private Sub Command1_Click()
Dim arrPriceQuantity(1 To 5, 1 To 2)
Dim i As Integer
For i = 1 To 5
arrPriceQuantity(i, 1) = i ' Series 1
arrPriceQuantity(i, 2) = i ^ 2 ' Series 2
Next i
MSChart1.ChartData = arrPriceQuantity
End Sub
Private Sub Command1_Click()
Dim arrPriceQuantity(1 To 5, 1 To 2)
Dim i As Integer
For i = 1 To 5
arrPriceQuantity(i, 1) = i ' Series 1
arrPriceQuantity(i, 2) = i ^ 2 ' Series 2
Next i
MSChart1.ChartData = arrPriceQuantity
End Sub