I'm trying to plot a single line on a graph using MSChart.
Instead of getting a single line, I get a series of lines which represent my data. Below is my code. txtX and txtY are textbox arrays that the user will use to input values for the line.
Private Sub cmdDraw_Click()
Dim arrData(2, 6)
Dim i, j, k As Integer
For i = 1 To 6
arrData(1, i) = txtX(i - 1).Text
arrData(2, i) = txtY(i - 1).Text
Next i
With LinGraph
.Repaint = False
.chartType = VtChChartType2dLine
.ColumnCount = 6
.RowCount = 6
.Data = arrData
.ColumnLabel = txtLinTrack.Text
.RowLabel = lblLinTag.Caption
.Repaint = True
End With
End Sub




Reply With Quote