Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
|
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 15th, 2009, 05:35 PM
Authorized User
 
Join Date: Jun 2008
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Default plotting 2 different 1 dimensional arrays versus each other

I have two one dimentional arrays I want to plot versus each other. Its just a basic x versus y plot. I have been trying to use mschart in vb 2008 but I have been unsuccessful. Can someone tell me how to create a simple x y plot on a form using the date stored in two arrays?
 
Old February 7th, 2009, 04:21 AM
Authorized User
 
Join Date: Dec 2008
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by sanderson View Post
I have two one dimentional arrays I want to plot versus each other. Its just a basic x versus y plot. I have been trying to use mschart in vb 2008 but I have been unsuccessful. Can someone tell me how to create a simple x y plot on a form using the date stored in two arrays?
Your request doesn't give much useful information.

Two arrays of what? You meantioned "date stored" but I think that was a typo for "data stored".

Then you meantion plotting x,y which is a single point so I assume that one array holds many x vaules and the other holds many y values. If this is try why dont you use a Point Structure and store the full x,y points in one array?

Are you asking for help looping through an array? Or are you asking for help with the MSChart control or are you asking for help useing the & operator to join multi values such as a value from each array?

You need to clearly specify what you want to accomplish, what you already know, and where your stuck before anyone can actually help you.


I assume this will help somewhat.

Code:
    Public Structure POINT
        Public X As Integer
        Public Y As Integer

        Public Sub New(ByVal X As Integer, ByVal Y As Integer)
            Me.X = X
            Me.Y = Y
        End Sub
    End Structure
 
Old February 12th, 2009, 07:33 PM
Authorized User
 
Join Date: Jun 2008
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Okay I will try to explain better this time. I have a temperature controller that is sending temperature values to my computer. As the temperature changes with time I want to plot a graph of the temperature versus time.

So if on a form I pressed a button I would want to take the temperature values I am reading in from the temperature controller and plot them versus the time such that by pressing the button time is 0 then 1 sec, 2 sec, 3 sec, 4 sec... and an example temp might be that a 1 sec the temp value is 25 degrees then 2 sec its 23 degees and at 3 sec its 20 degrees....

Does this make sense? How would I go about doing this?
Sorrt I was so unclear... hopefully this is better.
 
Old February 13th, 2009, 08:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there..

Well. You will need a timer object that starts when you press the buttom. If you want to draw on your form, you will need objects like pen. Your first problem is the size of the drawing. Could be very tricky to make it always fit your form, you will have to plot all the points every second.

You need help with the drawing part?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Plotting 2 1-dimensional arrays sanderson Visual Basic 2008 Essentials 0 January 15th, 2009 05:29 PM
muti dimensional arrays help:( chris1012 Java Basics 6 December 22nd, 2007 01:11 PM
1 and 2 dimensional arrays jeff_cafm VB.NET 2002/2003 Basics 1 April 26th, 2006 05:02 PM
1 and 2 dimensional arrays jeff_cafm VB.NET 1 April 24th, 2006 03:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.