By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

How to draw a line graph?

P: 46
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
Share this Question
Share on Google+
1 Reply

P: 319
Hello, Read this code:

Expand|Select|Wrap|Line Numbers
  1. Imports System
  2. Imports System.Drawing
  4. Public Class Form1
  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
  9.         'We make a new pen.
  10.         Dim myPen As New Pen(Color.White, 5)
  12.         'Draw a line.
  13.         'e keyword is the PaintEventArgs.
  14.         e.Graphics.DrawLine(myPen, 12, 12, 200, 200)
  16.         'Clean up from the memory.
  17.         e.Dispose()
  18.     End Sub
  19. End Class
Jun 10 '07 #2

Post your reply

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