Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

easy MSChart question

Status
Not open for further replies.

ctlin

Technical User
Apr 17, 2002
77
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top