Please help me how to get the perfect straight line in mschart.also to get the R2 of the the slope and y-intercept.here is my code.
here is the number to input to test the code:

Private Sub ABS1_KeyPress(Index As Integer, KeyAscii As Integer)
Dim s0, s1, s2, t0, t1 As Double
s0 = 0
s1 = 0
s2 = 0
t0 = 0
t1 = 0

Select Case Index
Case 0:

If KeyAscii = 13 Then
ABS1(1).SetFocus
End If
Case 1:
If KeyAscii = 13 Then
ABS1(2).SetFocus
End If
Case 2:
If KeyAscii = 13 Then
ABS1(3).SetFocus
End If
Case 3:
If KeyAscii = 13 Then
ABS1(4).SetFocus
End If
Case 4:
If KeyAscii = 13 Then
'How to get the data for the slope/y intercept computation
For X = 0 To 4
s0 = s0 + 1
s1 = s1 + CONC2(X)
s2 = s2 + (CONC2(X) * CONC2(X))
t0 = t0 + ABS2(X)
t1 = t1 + (CONC2(X) * ABS2(X))
''Plot Graph

For Y = 1 To 5
MSChart1.Row = Y
MSChart1.RowLabel = CONC2(Y - 1)
MSChart2.Row = Y
MSChart2.RowLabel = CONC2(Y - 1)

Next
'i got this slope and y intercept to the member of this forum also. thanks to him but i cant understand his R2 formulw(y=mx-b) i dont know where to get the x value.

Please help me to get the prefect line after removing the abs3(4)(abs3 is where the computation displayed)also how to get the regression or R2. Thanks

Note: I use line in chart..cause when i used the xy scattered the negative value did'nt plot on the last column instead it plot on the first row negative value.

I already change and nothing happen to my Regression result.(y=Mx-B) in my input which is x on that? Also my plot in graph is not straight from base on my screen shot.(pls. see attached file) Hope you can help me on this problem. Thanks.

Here is the code to get the Slope/Y intercept and Regrssion
and my inputs is on the first table in my screenshot
For X = 0 To 4
s0 = s0 + 1
s1 = s1 + CONC2(X)
s2 = s2 + (CONC2(X) * CONC2(X))
t0 = t0 + ABS2(X)
t1 = t1 + (CONC2(X) * ABS2(X))
''Plot Graph

I already try that before in excel on how to have a straight line if your input the ff.data.in excel it used a xy scatter graph to have a straight line but my problem in VB is if i used xy scatter the last input would be plot under the first input unlike if i used line graph u will see the line of last input.did you get me?