473,659 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to plot graph

9 New Member
i'm using vb to plot graph. i've already drawn the graphsheet using drawlines. and include labels. all i arrange according to pixels. the problem i face now is that i need to plot certain symbols like 'x', 'o' , '>' etc. on the graph. not by drawing but automatically when it get's the value from a label. how do i do that? i think i have to use array. but i cant get through what i want to do. help pls.
Jun 18 '07 #1
12 13885
Killer42
8,435 Recognized Expert Expert
i'm using vb to plot graph. i've already drawn the graphsheet using drawlines. and include labels. all i arrange according to pixels. the problem i face now is that i need to plot certain symbols like 'x', 'o' , '>' etc. on the graph. not by drawing but automatically when it get's the value from a label. how do i do that? i think i have to use array. but i cant get through what i want to do. help pls.
Not sure exactly what part of this is the problem. (Also, what version of VB are you using?)

In VB6 at least, I believe you can simply use the .Print method to print letters/symbols directly on the form or picturebox, or place transparent labels at the appropriate points so that their caption appears to be on the form/picturebox.
Jun 18 '07 #2
slowgirl
9 New Member
Not sure exactly what part of this is the problem. (Also, what version of VB are you using?)

In VB6 at least, I believe you can simply use the .Print method to print letters/symbols directly on the form or picturebox, or place transparent labels at the appropriate points so that their caption appears to be on the form/picturebox.
I'm using vb 2005 express edition. my problem here is that I have drawn the graphsheet using drawlines. I've simply added labels and arrange them according to the pixels corresponding to the lines i've drawn. Now, I need to plot the graph with symbols which I have created, also by drawing. But my program should work in such a way that I can automatically plot that certain symbol when it gets the value from a label from another form from the same project.
Jun 18 '07 #3
Killer42
8,435 Recognized Expert Expert
I'm using vb 2005 express edition. my problem here is that I have drawn the graphsheet using drawlines. I've simply added labels and arrange them according to the pixels corresponding to the lines i've drawn. Now, I need to plot the graph with symbols which I have created, also by drawing. But my program should work in such a way that I can automatically plot that certain symbol when it gets the value from a label from another form from the same project.
Sorry, I still don't understand the problem. Why can't you just .Print the symbols onto the "graphsheet "? It would help if you could describe your setup. What exactly is the graphsheet? A picturebox? (I use VB6, so I may be just missing something that's obvious in VB 2005.)
Jun 18 '07 #4
slowgirl
9 New Member
Sorry, I still don't understand the problem. Why can't you just .Print the symbols onto the "graphsheet "? It would help if you could describe your setup. What exactly is the graphsheet? A picturebox? (I use VB6, so I may be just missing something that's obvious in VB 2005.)

it's a paint event. here are my codes. even the symbols i'm drawing. How exactly do I use the .print method?

Expand|Select|Wrap|Line Numbers
  1. Public Class UmmAudiogram
  2.  
  3.     Private Sub UmmAudiogram_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  4.         Dim blackPen As Pen = New Pen(Color.Black, 1.5)
  5.         Dim point1 As Point = New Point(80, 50)
  6.         Dim point2 As Point = New Point(480, 50)
  7.         Me.CreateGraphics.DrawLine(blackPen, point1, point2)
  8.  
  9.         Dim point3 As Point = New Point(80, 70)
  10.         Dim point4 As Point = New Point(480, 70)
  11.         Me.CreateGraphics.DrawLine(blackPen, point3, point4)
  12.  
  13.         Dim point5 As Point = New Point(80, 90)
  14.         Dim point6 As Point = New Point(480, 90)
  15.         Me.CreateGraphics.DrawLine(blackPen, point5, point6)
  16.  
  17.         Dim point7 As Point = New Point(80, 110)
  18.         Dim point8 As Point = New Point(480, 110)
  19.         Me.CreateGraphics.DrawLine(blackPen, point7, point8)
  20.  
  21.         Dim point9 As Point = New Point(80, 130)
  22.         Dim point10 As Point = New Point(480, 130)
  23.         Me.CreateGraphics.DrawLine(blackPen, point9, point10)
  24.  
  25.         Dim point11 As Point = New Point(80, 150)
  26.         Dim point12 As Point = New Point(480, 150)
  27.         Me.CreateGraphics.DrawLine(blackPen, point11, point12)
  28.  
  29.         Dim point13 As Point = New Point(80, 170)
  30.         Dim point14 As Point = New Point(480, 170)
  31.         Me.CreateGraphics.DrawLine(blackPen, point13, point14)
  32.  
  33.         Dim point15 As Point = New Point(80, 190)
  34.         Dim point16 As Point = New Point(480, 190)
  35.         Me.CreateGraphics.DrawLine(blackPen, point15, point16)
  36.  
  37.         Dim point17 As Point = New Point(80, 210)
  38.         Dim point18 As Point = New Point(480, 210)
  39.         Me.CreateGraphics.DrawLine(blackPen, point17, point18)
  40.  
  41.         Dim point19 As Point = New Point(80, 230)
  42.         Dim point20 As Point = New Point(480, 230)
  43.         Me.CreateGraphics.DrawLine(blackPen, point19, point20)
  44.  
  45.         Dim point21 As Point = New Point(80, 250)
  46.         Dim point22 As Point = New Point(480, 250)
  47.         Me.CreateGraphics.DrawLine(blackPen, point21, point22)
  48.  
  49.         Dim point23 As Point = New Point(80, 270)
  50.         Dim point24 As Point = New Point(480, 270)
  51.         Me.CreateGraphics.DrawLine(blackPen, point23, point24)
  52.  
  53.         Dim point25 As Point = New Point(80, 290)
  54.         Dim point26 As Point = New Point(480, 290)
  55.         Me.CreateGraphics.DrawLine(blackPen, point25, point26)
  56.  
  57.         Dim point27 As Point = New Point(80, 310)
  58.         Dim point28 As Point = New Point(480, 310)
  59.         Me.CreateGraphics.DrawLine(blackPen, point27, point28)
  60.  
  61.         Dim pointA As Point = New Point(80, 50)
  62.         Dim pointB As Point = New Point(80, 310)
  63.         Me.CreateGraphics.DrawLine(blackPen, pointA, pointB)
  64.  
  65.         Dim pointC As Point = New Point(100, 50)
  66.         Dim pointD As Point = New Point(100, 310)
  67.         Me.CreateGraphics.DrawLine(blackPen, pointC, pointD)
  68.  
  69.         Dim pointE As Point = New Point(120, 50)
  70.         Dim pointF As Point = New Point(120, 310)
  71.         Me.CreateGraphics.DrawLine(blackPen, pointE, pointF)
  72.  
  73.         Dim pointG As Point = New Point(140, 50)
  74.         Dim pointH As Point = New Point(140, 310)
  75.         Me.CreateGraphics.DrawLine(blackPen, pointG, pointH)
  76.  
  77.         Dim pointI As Point = New Point(160, 50)
  78.         Dim pointJ As Point = New Point(160, 310)
  79.         Me.CreateGraphics.DrawLine(blackPen, pointI, pointJ)
  80.  
  81.         Dim pointK As Point = New Point(180, 50)
  82.         Dim pointL As Point = New Point(180, 310)
  83.         Me.CreateGraphics.DrawLine(blackPen, pointK, pointL)
  84.  
  85.         Dim pointM As Point = New Point(200, 50)
  86.         Dim pointN As Point = New Point(200, 310)
  87.         Me.CreateGraphics.DrawLine(blackPen, pointM, pointN)
  88.  
  89.         Dim pointO As Point = New Point(220, 50)
  90.         Dim pointP As Point = New Point(220, 310)
  91.         Me.CreateGraphics.DrawLine(blackPen, pointO, pointP)
  92.  
  93.         Dim pointQ As Point = New Point(240, 50)
  94.         Dim pointR As Point = New Point(240, 310)
  95.         Me.CreateGraphics.DrawLine(blackPen, pointQ, pointR)
  96.  
  97.         Dim pointS As Point = New Point(260, 50)
  98.         Dim pointT As Point = New Point(260, 310)
  99.         Me.CreateGraphics.DrawLine(blackPen, pointS, pointT)
  100.  
  101.         Dim pointU As Point = New Point(280, 50)
  102.         Dim pointV As Point = New Point(280, 310)
  103.         Me.CreateGraphics.DrawLine(blackPen, pointU, pointV)
  104.  
  105.         Dim pointW As Point = New Point(300, 50)
  106.         Dim pointX As Point = New Point(300, 310)
  107.         Me.CreateGraphics.DrawLine(blackPen, pointW, pointX)
  108.  
  109.         Dim pointY As Point = New Point(320, 50)
  110.         Dim pointZ As Point = New Point(320, 310)
  111.         Me.CreateGraphics.DrawLine(blackPen, pointY, pointZ)
  112.  
  113.         Dim pointAa As Point = New Point(340, 50)
  114.         Dim pointAb As Point = New Point(340, 310)
  115.         Me.CreateGraphics.DrawLine(blackPen, pointAa, pointAb)
  116.  
  117.         Dim pointAc As Point = New Point(360, 50)
  118.         Dim pointAd As Point = New Point(360, 310)
  119.         Me.CreateGraphics.DrawLine(blackPen, pointAc, pointAd)
  120.  
  121.         Dim pointAe As Point = New Point(380, 50)
  122.         Dim pointAf As Point = New Point(380, 310)
  123.         Me.CreateGraphics.DrawLine(blackPen, pointAe, pointAf)
  124.  
  125.         Dim pointAg As Point = New Point(400, 50)
  126.         Dim pointAh As Point = New Point(400, 310)
  127.         Me.CreateGraphics.DrawLine(blackPen, pointAg, pointAh)
  128.  
  129.         Dim pointAi As Point = New Point(420, 50)
  130.         Dim pointAj As Point = New Point(420, 310)
  131.         Me.CreateGraphics.DrawLine(blackPen, pointAi, pointAj)
  132.  
  133.         Dim pointAk As Point = New Point(440, 50)
  134.         Dim pointAl As Point = New Point(440, 310)
  135.         Me.CreateGraphics.DrawLine(blackPen, pointAk, pointAl)
  136.  
  137.         Dim pointAm As Point = New Point(460, 50)
  138.         Dim pointAn As Point = New Point(460, 310)
  139.         Me.CreateGraphics.DrawLine(blackPen, pointAm, pointAn)
  140.  
  141.         Dim pointAo As Point = New Point(480, 50)
  142.         Dim pointAp As Point = New Point(480, 310)
  143.         Me.CreateGraphics.DrawLine(blackPen, pointAo, pointAp)
  144.         Dim G As Graphics = e.Graphics
  145.         Dim pen1 As New Pen(Color.Red, 2)
  146.         Dim pen2 As New Pen(Color.DarkBlue, 2)
  147.  
  148.  
  149.         Dim x As Integer
  150.         Dim y As Integer
  151.         Dim thresholdeLabel As Integer = 0
  152.         Dim freqqLabel As Integer = 0
  153.         Dim pt As Integer(,) = New Integer(x, y) {}
  154.         pt(200, 50) = freqqLabel
  155.         pt(200, 70) = freqqLabel
  156.         pt(200, 110) = freqqLabel
  157.  
  158.         For thresholdeLabel = 20 To pt(200, 110).ToString
  159.  
  160.         Next
  161.  
  162.         G.DrawLine(pen1, (x - 5), (y - 5), (x + 5), (y + 5)) 'drawing 'x'
  163.         G.DrawLine(pen1, (x + 5), (y - 5), (x - 5), (y + 5))
  164.  
  165.  
  166.         G.DrawLine(pen1, 115, 105, 125, 115) 'drawing 'x'
  167.         G.DrawLine(pen1, 125, 105, 115, 115)
  168.  
  169.         G.DrawLine(pen1, 195, 65, 205, 75)
  170.         G.DrawLine(pen1, 205, 65, 195, 75)
  171.  
  172.         G.DrawLine(pen1, 190, 130, 200, 125)
  173.         G.DrawLine(pen1, 190, 130, 200, 135) 'drawing '<'
  174.  
  175.         'draw '>'
  176.         G.DrawLine(pen2, 130, 110, 120, 115)
  177.         G.DrawLine(pen2, 130, 110, 120, 105)
  178.  
  179.         'drawing 'o'
  180.         Dim p1 As New Point(140, 86)
  181.         Dim p2 As New Point(144, 90)
  182.         Dim p3 As New Point(140, 94)
  183.         Dim p4 As New Point(136, 90)
  184.         Dim curvePoints As Point() = {p1, p2, p3, p4}
  185.         e.Graphics.DrawClosedCurve(pen2, curvePoints)
  186.  
  187.  
  188.     End Sub
  189. End Class
Jun 19 '07 #5
Killer42
8,435 Recognized Expert Expert
it's a paint event. here are my codes. even the symbols i'm drawing. How exactly do I use the .print method?
Sorry, I can't answer that. I'm only a VB6 user, and from your code I can see that this stuff works somewhat differently in VB2005. In VB6 you would simply use the .Print method of the form or picturebox control, like Picture1.Print "ABC". In VB20005, I have no idea. Try checking out your doco, see whether there's an equivalent.
Jun 19 '07 #6
slowgirl
9 New Member
Sorry, I can't answer that. I'm only a VB6 user, and from your code I can see that this stuff works somewhat differently in VB2005. In VB6 you would simply use the .Print method of the form or picturebox control, like Picture1.Print "ABC". In VB20005, I have no idea. Try checking out your doco, see whether there's an equivalent.

alright. thanks alot killer42. appreciate it ('',)
Jun 19 '07 #7
Killer42
8,435 Recognized Expert Expert
alright. thanks alot killer42. appreciate it ('',)
No problem.

Um... it might not hurt to drop a message in the .Net forum, too - perhaps you'll find more VB.Net experience over there.
Jun 19 '07 #8
Ishascp
2 New Member
Hello
Can you help me in real timeplotting. I don't know how it could be possible.
Sep 6 '07 #9
Killer42
8,435 Recognized Expert Expert
Hello
Can you help me in real timeplotting. I don't know how it could be possible.
I don't know what you mean. What is timeplotting?
Sep 6 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1849
by: Jan Rienyer Gadil | last post by:
could anyone please help me! what and how is the best implementation of creating a table based on data coming from the serial port ? and also how would i be able to create graphs (2D) based on these data? opinions and suggestion are most highly welcome. thanks. jr
1
3078
by: Soon Lee | last post by:
any one know of any good way to plot graph using vb.net?
3
5908
by: arda | last post by:
i have a program and this program has output values and i wanna draw a 2D graph for these outputs. How can i achieve this?
3
1545
by: siyoyok007 | last post by:
hello guys, my system needs the use of graph but i don't know the step on doing it. I use microsoft access as the database and want to convert it into a graph. can anyone give some examples or link that i can refer to. thnx
3
10020
by: ray | last post by:
Hi, I would like to ask how to plot graph in vb.net on the interface? Is it possible? Thanks a lot, Ray
0
1812
by: mostafijur | last post by:
Hello I want to show continuous graph using Gnu plot. That means after 1 hour I want to see previous every 10 mins graph. Gnu Plot Version: 4.0, Linux kernel: 2.6, UBUNTU I can access Gnu plot using C language in Linux. Is it possible to show scroll bar in Gnu plot graph window to see previous graph?
5
3916
by: 9jaguy | last post by:
Guys, I treally appreciate the way questions are answered on this forum. I hope I get someone to help on this quickly too. :) I am using vb 2005 and getting data directly from two sensors in two separate rtf text boxes labelled X and Y coordiantes. I now need to plot a graph real time that can get use the values from the rtf boxes to plot the coordinates. The initial reading from the sensors when it is switched on is the original value and...
0
2265
by: peridian | last post by:
Hi, I have an image of an equilateral triangle, where the base of the triangle meets the base of the image perfectly. The image itself is square. I need to be able to dynamically plot out points as an overlay on the image, as though plotting a ternary plot graph. Obviously, the image is a square that uses cartesian co-ordinates. If I know that one corner of the triangle is at (0,0), and the other corner is at (320,0), I should be able...
2
3269
by: maximus tee | last post by:
hi all, i'm new to python and this is advanced for me. is there a way to plot data with python? i want to plot EyVt, EyHt on the Y-axis and Lane on the X-axis as attached or below. currently i'm using Python2.5 and Win XP. thanks a lot. Eg: Platform: PC Tempt : 25 TAP0 :0 TAP1 :1 +++++++++++++++++++++++++++++++++++++++++++++
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.