|
-
Nov 13th, 2008, 02:33 AM
#1
Thread Starter
New Member
How to Make XY Graph In VB
Hi,
I have the following x and y coordinates.
x y
== ==
2 4
5 7
11 4
9 20
How to draw the x-y graphs with a straight line start from origin (0,0) connected to each coordinate (x,y). Most of the tutorial that i know don;t show details of the steps and not similar at all.
Thanks guys
-
Nov 13th, 2008, 02:50 AM
#2
Re: How to Make XY Graph In VB
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 13th, 2008, 04:45 AM
#3
Lively Member
Re: How to Make XY Graph In VB
Assuming you already have it scaled properly, it's pretty simple.
Code:
picturebox.line (x1,y1)-(x2,y2)
consider x1 and y1 the coordinates of the first point, and x2,y2 as the second point, connecting the two with a straight line.
I'll do the scale, the basic lines for the graph, and the first two lines. go ahead do the last two yourself, see how simple it is.
Code:
Private Sub Command1_Click()
picOutput.Scale (-2, 30)-(30, -3) 'Scales the graph
picOutput.Line (-2, 0)-(30, 0) 'Draws x-axis
picOutput.Line (0, -3)-(0, 30) 'Draws y-axis
picOutput.line (0,0)-(2,4) ' First line
picOutput.Line (2, 4)-(5, 7) 'second line
End Sub
Last edited by nin6_8; Nov 13th, 2008 at 04:59 AM.
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
|