PC Review


Reply
Thread Tools Rate Thread

How can I plot a graph on the screen?

 
 
elemis
Guest
Posts: n/a
 
      22nd Nov 2004
Hi, do we have pixels that we can set in order to plot an x-y graph
on a form ?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TmlnZWwgQXJtc3Ryb25n?=
Guest
Posts: n/a
 
      22nd Nov 2004
Hi elemis

You need to have a look at the OnPaint method - here's an example in VB.NET
that draws a diagonal line.

Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
e.Graphics.DrawLine(Pens.Black, 100, 100, 200, 200)
End Sub

But you would probably be better off buying a graphing control, or
developing your own rather than putting all your graphing code into the Form
Paint...

HTH

Nigel Armstrong

"elemis" wrote:

> Hi, do we have pixels that we can set in order to plot an x-y graph
> on a form ?
>

 
Reply With Quote
 
=?Utf-8?B?TmlnZWwgQXJtc3Ryb25n?=
Guest
Posts: n/a
 
      22nd Nov 2004
And to follow up my own post, make sure you call MyBase.OnPaint(e) before
your own painting code.

Nigel Armstrong

"Nigel Armstrong" wrote:

> Hi elemis
>
> You need to have a look at the OnPaint method - here's an example in VB.NET
> that draws a diagonal line.
>
> Protected Overrides Sub OnPaint(ByVal e As
> System.Windows.Forms.PaintEventArgs)
> e.Graphics.DrawLine(Pens.Black, 100, 100, 200, 200)
> End Sub
>
> But you would probably be better off buying a graphing control, or
> developing your own rather than putting all your graphing code into the Form
> Paint...
>
> HTH
>
> Nigel Armstrong
>
> "elemis" wrote:
>
> > Hi, do we have pixels that we can set in order to plot an x-y graph
> > on a form ?
> >

 
Reply With Quote
 
elemis
Guest
Posts: n/a
 
      22nd Nov 2004
This is great, any ideas how a generate a paint event to refresh what
I am drawing?
 
Reply With Quote
 
=?Utf-8?B?TmlnZWwgQXJtc3Ryb25n?=
Guest
Posts: n/a
 
      22nd Nov 2004
Try the Invalidate() method.

HTH

Nigel Armstrong

"elemis" wrote:

> This is great, any ideas how a generate a paint event to refresh what
> I am drawing?
>

 
Reply With Quote
 
Bob
Guest
Posts: n/a
 
      3rd Dec 2004
Take a look at XYGraph from http://www.componentXtra.com. The basic version is free.

---
Bob
componentXtra
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I plot multiple series on one graph? - test-graph.xls (0/1) Leo Bueno Microsoft Excel Charting 1 2nd Aug 2007 12:49 PM
how do I create a box-plot (or whisker plot ) graph? =?Utf-8?B?cmFhbA==?= Microsoft Excel Charting 1 8th Aug 2005 08:31 PM
how to plot graph in VB.net? Soon Lee Microsoft Dot NET 1 30th Dec 2004 10:36 AM
plot graph =?Utf-8?B?bWljaGVhbA==?= Microsoft Frontpage 1 2nd Dec 2003 12:13 PM
How not to plot zero in graph ? Mire Microsoft Excel Programming 0 24th Sep 2003 01:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:21 AM.