Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 Real-Time Graphics Tools for .Net (VB and C#)
 Using arbitrary units of time on X-Axis plots
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mswlogo

10 Posts

Posted - 08 Mar 2007 :  18:46:03  Show Profile  Reply with Quote

I wish to build a Graph that has a fixed window that is horizontally scrollable and data will be added to the dataset dynamically over time.

But the X-Axis is not time based.

I notice all RT Charts always have time as the X-Axis.

Can the X-Axis be any units.

I seem to recall looking at this a few years ago and the models seemed to assume you just fed it Y values only and you set the chart up for time update period.

I want to dynamically give it X,Y data points dynamically and add to the current dataset.

I'm finding a little awkward doing this with the 2D package and was not sure if the RT package would clean things up. But I can't quite get my arms around what the RT package can and cannot do.

Thanks.

quinncurtis

1164 Posts

Posted - 09 Mar 2007 :  10:08:00  Show Profile  Reply with Quote
Scrolling graphs that use a managed RTScrollFrame, as do most all of our scrolling graph examples, are not restricted to time-based values.

You can just as easily use a graph that is based on a simple numeric range for both x and y. You would replace the TimeCoordinate scaling with CartesianCoordinate scaling. You would replace the TimeAxis x-axis with a LinearAxis. And you would replace the x-axis's TimeAxisLabels with NumericAxisLabels.

Most of our examples only pass in the y-values for real-time updates. In these cases the x-value is assumed to be the current time of day, as in the example below:

currentTemperature1.SetCurrentValue(currentTemperatureValue1);
currentTemperature2.SetCurrentValue(currentTemperatureValue2);


But, the SetCurrentValue method also has many overrides, described in the manual, that also allow you to pass in an explicit time-of-day, or as in your case, a double numeric value, as in the example below:
// This method uses an explicit time stamp, which is the update count in this case
double xvalue = (double) count;
currentTemperature1.SetCurrentValue((double) xvalue, currentTemperatureValue1);
currentTemperature2.SetCurrentValue((double) xvalue, currentTemperatureValue2);


You can download a modified version of our ScrollApplication1 example program that implements a simple version of a scrolling graph using a simple numeric scale. http://quinn-curtis.com/downloadsoftware/ScrollApplication2.zip

Go to Top of Page

mswlogo

10 Posts

Posted - 09 Mar 2007 :  11:13:59  Show Profile  Reply with Quote
Awesome!! you guys are great.

Just one more question on that example.

Is all the data collected still in the chart and can be scrolled back to?
Go to Top of Page

quinncurtis

1164 Posts

Posted - 09 Mar 2007 :  11:44:31  Show Profile  Reply with Quote
Yes, data that scrolls off of the screen is still in the dataset buffers. The data is simply being clipped to the current chart scale. See the Polygraph example for an example of scrolling back in time using a scrollbar.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07