T O P I C R E V I E W |
soundar |
Posted - 02 Feb 2010 : 19:40:22 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. |
4 L A T E S T R E P L I E S (Newest First) |
quinncurtis |
Posted - 08 May 2012 : 09:15:45 Once created, the RTScrollFrame controls the coordinate system. It does pull it's starting values, and frame extent from original coordinate system values, but once it starts updating, it is completely driven by the RTProcessVar data values. So any changes to the coordinate system are temporary, because with each call to the ChartView UpdateDraw method, the RTScrollFrame always looks to its setup values and the data and adjusts the RTScrollFrame accordingly.
If you want to just change the x-axis extent of the scroll frame (maximumX - minimumX), you can do that using the scroll frames FrameExtent property, expressing the frame extent in milliseconds.
// change scroll frame extent to 240 seconds scrollFrame1.FrameExtent = 240000
If you want to do more than that, you should adjust the coordinate the way you want, and then create a new RTScrollFrame using the adjusted coordinate system as the initial coordinate system value and adding in the RTProcessVar objects you want to control the scroll frame, just as you did when creating the original scroll frame. Then delete the old scroll frame from the ChartView object list, and add the new one in its place.
chartVu.DeleteChartObject(oldScrollFrame); chartVu.AddChartObject(newScrollFrame);
|
BarryRobertson |
Posted - 07 May 2012 : 23:06:59 I am having a similar problem. I tried setting with SetScaleStart/StopX and SetTmeScaleStart/Stop and now this option, but they all do the same thing.
The axis changes, but as soon as the scale needs to move with time, it reverts to the original setting I constructed it with.
Any ideas? |
soundar |
Posted - 04 Feb 2010 : 15:42:51 Thanks. It worked. |
quinncurtis |
Posted - 03 Feb 2010 : 10:22:38 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);
|
|
|