473,587 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ 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::On Timer()
{
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 1435
> 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::On Timer()
{
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************* *********@hotma il.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
11913
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 or call graph). I have found a script to handle the graph in memory but i can already do that, my problem is to draw it (it an optimal way, and...
0
1655
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 another graph with different data populated in that graph. I want to know how to provide href for each bar in the graph in the code behind.
0
1348
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 another graph with different data populated in that graph. I want to know how to provide href for each bar in the graph in the code behind.
3
4573
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 report has started printing the properties can't be changed. It can be done with an MDB by opening it in design mode hidden, making the change,...
1
3622
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
1636
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 stock over that period. I want to give the user the functionality to draw a line on the graph (Straight line) representing what they consider the trend....
2
276
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 line of 5 nodes (Initial State till the Goal State). Can somebody please help me to solve this problme? Thank you. I do very appreciate if somebody...
9
3163
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 want to be able to draw lines in a picturebox based upon certain data points I have received. I dragged a picturebox from the toolbar onto my form,...
6
2585
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 y-axis like 500,1000,1500 upto value which I have mentioned in $max variable which in my case is 4000. Here is the code <?php ...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6621
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...
1
5713
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...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
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...

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.