|
-
July 31st, 2001, 12:05 AM
#1
Plotting Graphs
How do I plot graphs in visual basic.
I have 2 sets of array values (one for x axis, one for y axis).
Could you provide me examples on how to plot graphs?
Thank You.
Dev.
-
July 31st, 2001, 12:56 AM
#2
Re: Plotting Graphs
Sub PlotGraph(x(),y())
ScaleMode = 3 'set scale in pixel
DrawWidth = 8 'set width line
for i = 0 to UBound(x) - 1
Line (x(i), y(i))-(x(i + 1), y(i + 1))
next i
End Sub
Andy Tower
-
July 31st, 2001, 03:59 AM
#3
Re: Plotting Graphs
Add a msChart to your formadd this code under command 1Option Explicit
Private Sub Command1_Click()With MSChart1 Dim arrData(1 To 3, 1 To 3)
arrData(1, 1) = "Jan" ' Set the labels in thefirst series.
arrData(2, 1) = "Feb" arrData(3, 1) = "Mar" arrData(1, 2) = 8
arrData(2, 2) = 4 arrData(3, 2) = 0.3 arrData(1, 3) = 0.2
arrData(2, 3) = 3 arrData(3, 3) = 6.3 MSChart1.ChartData = arrData
End WithEnd Sub
-
August 1st, 2001, 02:46 AM
#4
Re: Plotting Graphs
'You mean:
'Add a msChart to your form
'add this code under command 1
option Explicit
private Sub Command1_Click()
Dim arrData(1 to 3, 1 to 3)
arrData(1, 1) = "Jan" ' set the labels in thefirst series.
arrData(2, 1) = "Feb"
arrData(3, 1) = "Mar"
arrData(1, 2) = 8
arrData(2, 2) = 4
arrData(3, 2) = 0.3
arrData(1, 3) = 0.2
arrData(2, 3) = 3
arrData(3, 3) = 6.3
MSChart1.ChartData = arrData
End Sub
Next time enclose your post in *[vbocde]* and *[/vbcode]* tags (without "*" chars)
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
|