|
-
Oct 10th, 2005, 08:39 PM
#1
Thread Starter
New Member
Draw graph on picture box
Hi
I need to plot a series graph ( x-axis is 'time in minute',y-axis is data) on a picture box uisng VB6.0 ( no dotNET). The data are from a data file named mydata.txt.
But I have not figure out how to do it . could somebody pls show me how?
Thanks
-
Oct 10th, 2005, 09:21 PM
#2
Re: Draw graph on picture box
-
Oct 10th, 2005, 10:23 PM
#3
Thread Starter
New Member
Re: Draw graph on picture box
Hi Lintz
I tried , but I need to read data from the datafile, how?
I also need a scaled x,y axis.
Thanks
-
Oct 11th, 2005, 06:32 AM
#4
Re: Draw graph on picture box
I'm not sure about the scales (but I wouldn't mind knowing myself ) but this will open a file and plot the data.
VB Code:
Private Sub Form_Load()
Dim xPoint As Single
Dim yPoint As Single
Dim s As String
Dim PlotData() As String
Picture1.ScaleHeight = 100
Picture1.ScaleWidth = 100
FirstValue = True
Open "C:\MyData.txt" For Input As #1
Do Until EOF(1) = True
Line Input #1, s
PlotData = Split(s, ",")
Picture1.Line (xPoint, yPoint)-(PlotData(0), PlotData(1))
xPoint = PlotData(0)
yPoint = PlotData(1)
Loop
Close #1
End Sub
Last edited by lintz; Oct 12th, 2005 at 01:08 AM.
-
Oct 11th, 2005, 11:50 PM
#5
Thread Starter
New Member
Re: Draw graph on picture box
Hi Lintz
Thank you very much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|