473,732 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to draw a line graph?

46 New Member
Hi all..
How to draw a line graph? My axis-x is the daily hour from 8am to 8pm. Can i use a XY mschart type to draw it? Or I must use a picture box to draw it? If with XY chart type, how to draw?
Thank you..
Jun 10 '07 #1
1 4390
Atran
319 Contributor
Hello, Read this code:

Expand|Select|Wrap|Line Numbers
  1. Imports System
  2. Imports System.Drawing
  3.  
  4. Public Class Form1
  5.  
  6.     'We make a new paint event handler.
  7.     Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As PaintEventArgs) Handles MyBase.Paint
  8.  
  9.         'We make a new pen.
  10.         Dim myPen As New Pen(Color.White, 5)
  11.  
  12.         'Draw a line.
  13.         'e keyword is the PaintEventArgs.
  14.         e.Graphics.DrawLine(myPen, 12, 12, 200, 200)
  15.  
  16.         'Clean up from the memory.
  17.         e.Dispose()
  18.     End Sub
  19. End Class
  20.  
Jun 10 '07 #2

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

Similar topics

11
14893
by: srinivas | last post by:
Hi all, I have one requirement.Is there any way to create a line graph using javascript.If it is please send me the sample code.But the thing is it should work in all browsers. Thanks, Srinivas
4
21532
by: Tiggy | last post by:
I am wondering if there exists any component in VB .Net allowing to draw a graph in X and Y ? Of course I can draw line by line but is there not another way to do it and will it be possible to easily export in excel by this way (I mean without filling the spreadsheet with the value....) ? Thanks for helping, tiggy
1
12721
by: balakrishnan.dinesh | last post by:
Hi frnds, Im creating function to plot line graph in javascript . I have marked the points in graph. but what i need to do is, i want to draw the line between those marked point, but i dont konw how to draw line betwwen the marked points The output for my function will be like this , So the marked point (*) should be connected through lines,
9
7082
by: balakrishnan.dinesh | last post by:
Hi frnds, I want to draw pie graph or line graph through javascript. Can anyone give me a sample code for these charts. Thank you Dinesh
2
3460
by: Lamis | last post by:
Hi, I want to draw a line graph in my C# form. it is in real time so the graph will constantly get new values. it should show one line for maximum value, one line for minimum value and a third for the current value.. any idea how to do that in C#. I am thank full for all help coz I dont know even how to start. -- LZ
0
2706
by: suedasszyy | last post by:
Haiiii.... i'm new for VB.net. can someone help me to solve those question? is it possible to draw a graph such as Sin graph using console application? if not, how can i draw a graph ,example sin graph in window form but i must give the commands in console application ?
0
2519
by: vimalapalanichamy | last post by:
Actually i am using PIC16F877 controller for my project.The inputs for the line graph are came from controller (through RS232).Now i am trying to get the data through RS232 from the controller to vb frontend (using mscomm).My next step is,draw the line graph to show the variation of that received data's.please help me for this.And also send some source code for this
7
3434
by: =?iso-8859-1?Q?Vicente_Garc=EDa?= | last post by:
Hi, I need to programmatically draw a graph (his nodes and his edges) from dynamic XML file. The graph is very complex and I don't know how I could do this task. Any ideas please? Microsoft Sparkle? Thanks in advance, Vicente.
3
6835
by: mistusen | last post by:
the nodes of the graph has got x and y coordinate.we'll have to draw a directed graph with the nodes in java.where can i find the source code or what is used to draw the graph?plz suggest.how can i draw the graph...
0
8946
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
8774
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,...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9181
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
8186
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...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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
3
2180
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.