473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drawing a Graph (value vs time)


Hi,

I'm new to C++ and i can't seem to find a tutorial on the net for this
one.

I have a dialog based MFC app running that reads sensors using a USB
interface device.

At the moment the varying data just moves a progress bar up and down.
I'm looking for a way to display this sensor data as a graph on the
screen. There are variables in my program that chenge as the sensor
reading changes, so all i need to do is plot this against time on a
line graph.
Here is some pseudocode for an example;

prognameDlg::OnTimer()
{
sensor1 = readData();
plot x,sensor1;
x++;
}

Code like this would just plot points as it moved along the screen. I'm
guessing this should be quite simple, but i dont even know where to
start.

I suppose i need some sort of control or frame for the graph. I also
need to know how to draw the lines in it and make it scroll or restart
from the beginning.

Please can someone let me know where to start, or post a link to a
tutorial if you know of one.

Thanks,
RichMo

--
RichMo
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

May 31 '06 #1
1 1428
> I'm new to C++ and i can't seem to find a tutorial on the net for this
one.

I have a dialog based MFC app running that reads sensors using a USB
interface device.

At the moment the varying data just moves a progress bar up and down.
I'm looking for a way to display this sensor data as a graph on the
screen. There are variables in my program that chenge as the sensor
reading changes, so all i need to do is plot this against time on a
line graph.
Here is some pseudocode for an example;

prognameDlg::OnTimer()
{
sensor1 = readData();
plot x,sensor1;
x++;
}

Code like this would just plot points as it moved along the screen. I'm
guessing this should be quite simple, but i dont even know where to
start.

I suppose i need some sort of control or frame for the graph. I also
need to know how to draw the lines in it and make it scroll or restart
from the beginning.

Please can someone let me know where to start, or post a link to a
tutorial if you know of one.


Hi,

Maybe this can help you :
http://www.codeproject.com/miscctrl/ntgraph_activex.asp
create a buffer in which you store data as it is coming in, and then
update the graph accordingly.

if you are new to C++, then I can recommend www.codeproject.com
as a good place to search for tutorials and articles.

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Jun 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: TheDD | last post by:
Hi all, i have a question: is there any librairy for drawing graphs with PHP? Not graphs like histogram or alike, but like a set of shapes linked together in a certain way (like a flow chart...
0
by: SS KANAGAL | last post by:
Hello, I am drawing a bar graph in an aspx page using System.Drawing namespace . Now I want to provide drill down facility for the graph i.e. on click of a bar in the graph it should get me yet...
0
by: SS KANAGAL | last post by:
Hello, I am drawing a bar graph in an aspx page using System.Drawing namespace . Now I want to provide drill down facility for the graph i.e. on click of a bar in the graph it should get me yet...
3
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the...
1
by: DBC User | last post by:
Hi Sharpies, This is a very basic question. I am using .Net IDE 2003 and System.Drawing.dll (1.1.4322). I wrote a simple program like this (ommitting the commons) using System.Drawing; .....
1
by: anthonyroche | last post by:
Does anyone know of a product that allows a user to draw a line on a chart? eg A historical stock tracker would have a line graph of say Aug 03 to Dec 03, which is a line graph representing a...
2
by: ys | last post by:
Good day.Currently I am doing Knowledge Base Planner. I do wish to show a result of my plan on the interface. What should i read in Graphics / Drawing to display my result by showing a straight...
9
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I...
6
by: gubbachchi | last post by:
Hi all, I have got a problem with plotting bar graph using GD. I am learning GD now. I have written the code for basic bar graph with one bar. What I need is, scale on Y-axis i.e. divisions on...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
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...
0
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,...
1
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.