andi21
Junior Member level 1
dear all master...
i have a problem in vb
I have a run time data (from micro), and I upload the data into a line graph in vb, and store the data into Ms.Access..
my problem is, in this program, if my data more than 20,it will be unread..
I want to make the X axis is flexible..
ex:
if the sample data only 15,so the X axis is 15
if the sample data 200, so the X axis is 200
can anyone help???
-----------------------------------------------
here is my simple graph :
Private Sub Form_Load()
Dim i As Integer
Dim x As Single
Dim y As Single
Picture1.Scale (0, 20)-(20, 0)
' Draw X axis.
Picture1.Line (-10, 0)-(10, 0)
For i = -20 To 20
Picture1.Line (i, -20)-(i, 20)
Next i
' Draw Y axis.
Picture1.Line (0, -10)-(0, 10)
For i = -20 To 20
Picture1.Line (-20, i)-(20, i)
Next i
Picture1.ForeColor = vbBlue
x = 0
y = x + 1
Picture1.CurrentX = x
Picture1.CurrentY = y
For x = 0 To 10 Step 0.25
y = x + 1
Picture1.Line -(x, y)
Next x
End Sub
----------------------------------------------
i have a problem in vb
I have a run time data (from micro), and I upload the data into a line graph in vb, and store the data into Ms.Access..
my problem is, in this program, if my data more than 20,it will be unread..
I want to make the X axis is flexible..
ex:
if the sample data only 15,so the X axis is 15
if the sample data 200, so the X axis is 200
can anyone help???
-----------------------------------------------
here is my simple graph :
Private Sub Form_Load()
Dim i As Integer
Dim x As Single
Dim y As Single
Picture1.Scale (0, 20)-(20, 0)
' Draw X axis.
Picture1.Line (-10, 0)-(10, 0)
For i = -20 To 20
Picture1.Line (i, -20)-(i, 20)
Next i
' Draw Y axis.
Picture1.Line (0, -10)-(0, 10)
For i = -20 To 20
Picture1.Line (-20, i)-(20, i)
Next i
Picture1.ForeColor = vbBlue
x = 0
y = x + 1
Picture1.CurrentX = x
Picture1.CurrentY = y
For x = 0 To 10 Step 0.25
y = x + 1
Picture1.Line -(x, y)
Next x
End Sub
----------------------------------------------