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
 Real-Time Graphics Tools for .Net (VB and C#)
 Showing elapsed time on the x-axis
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

soundar

51 Posts

Posted - 29 Feb 2008 :  02:37:03  Show Profile  Reply with Quote
Sorry, I posted this on another forum by mistake.

Is there any way to show the elapsed time on the x-axis, starting at 00:00:00 instead of the actual time?
Thanks.

quinncurtis

1586 Posts

Posted - 29 Feb 2008 :  09:32:02  Show Profile  Reply with Quote
There is no "elapsed time" scale; time scales must be initialized with valid date/time record.

You cannot use a start time of January 1, 1 AD, which would coorespond to a start time of 0.

But all you are interested in representation of an elapsed time scale. So just start your time scale with todays date (or any date really), initial time - 0:00:00. And end you time scale with todays date, some other time - 3:30:00. Use a TimeAxisLabels time label format that does not show the date, only the time. See the example program ScatterPlots.ScatterPoints.

ChartCalendar currentDate = new ChartCalendar();
ChartCalendar.SetTOD(currentDate,0,0,0);
.
.
.
TimeAxisLabels xAxisLab = new TimeAxisLabels(xAxis);
// Get rid of the initial date crossover label under the 0:00:00
xAxisLab.DateCrossoverMode = ChartObj.NO_DATECROSSOVER;

xAxisLab.AxisLabelsFormat = ChartObj.TIMEDATEFORMAT_24HMS;


If you start with a time scale in the 0:00:00 - XX:XX:XX range you must make sure that the time stamp on the data you use to update the real-time variable represents the proper time. Use the overlaod of SetCurrentValue that uses an explicit time stamp.

ChartCalendar tod = new ChartCalendar();  // get current time
// Increment elapsed time 10 seconds for each update.
ChartCalendar.SetTODSeconds(currentDate, 10 * updateCounter);

currentTemperature1.SetCurrentValue(tod, currentTemperatureValue1);
updateCounter++;




Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07