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#)
 How do I rescale time axis extents?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

soundar

32 Posts

Posted - 02 Feb 2010 :  19:40:22  Show Profile  Reply with Quote
I cannot figure out how to change the time axis extents in a QCRtGraph.NET once the graph is created.
In my program
  • I create the initialize the graph when the form loads. The scroll frame is an RT_MAXEXTENT_FIXEDSTART_AUTOSCROLL. If the form is loaded at 10:00AM then the time axis starts at 10:00 AM
  • User clicks the start button at 10:05. Data is fed to the graph and the first point is plotted at 10:05. This is acceptable.
  • User clicks Stop at 11:00. Data is stopped and the graph extent is now from 10 AM to 11AM User clicks Start again 1 PM
  • Now I clear the graph by using TruncateProcessVarDataset method and then update draw method. This also works.
  • But I want the time axis to start anew from 1 PM and continue. I cannot get this to happen - I tried transform's SetTimeScaleStart method, scrollframes RescaleAxesToCurrentTransform method etc, but whatever I tried, it either does not work or the program crashes with an invalid argument error inside the chart DLL.


I appreciate any help.I have searched these forums for any clue but cannot find anything that I have not tried.

quinncurtis

1164 Posts

Posted - 03 Feb 2010 :  10:22:38  Show Profile  Reply with Quote
You can use the ScrollFrame RescaleFrame method to do that


ChartCalendar newstarttime = ChartCalendar.NewCalendar(startTime);
ChartCalendar newendtime = ChartCalendar.NewCalendar(endTime);
newstarttime.Add(ChartCalendar.MINUTE, 60);
newendtime.Add(ChartCalendar.MINUTE, 60);

scrollFrame.RescaleFrame(newstarttime.GetCalendarMsecs(), scrollFrame.ChartObjScale.ScaleStartY,
newendtime.GetCalendarMsecs(), scrollFrame.ChartObjScale.ScaleStopY);

Go to Top of Page

soundar

32 Posts

Posted - 04 Feb 2010 :  15:42:51  Show Profile  Reply with Quote
Thanks. It worked.
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