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#)
 ScrollFrame y-axis auto-scaling
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mswlogo

10 Posts

Posted - 06 Jun 2007 :  12:17:10  Show Profile  Reply with Quote
I have a RT Graph setup as follows

mScrollFrame = new RTScrollFrame(this, mDataset, mTransform, ChartObj.RT_FIXEDEXTENT_MOVINGSTART_AUTOSCROLL);
mScrollFrame.ScrollScaleModeY = ChartObj.RT_AUTOSCALE_Y_MINMAX;

Is there a way I can have the Y Auto scale to ALL the data rather than just the current extent.

It's really kind of useless the way it is. And I don't see a way around it. Because we have a slightly noisy signal coming in and the user wants to observe it's overall strength. But it always a wiggly line through the middle. To see it's strength the user has to read the scale. But the purpose of the chart is to give the user a graphical feeling of the data. If the user has to read the scale I could just display a windowed average value (no chart).

Even in your little NASDAQ Icon in this forum I see a chart with large fluctuation. But I have to read the scale to know that it's varying very little. Sometimes you want to show small changes and sometimes you want to show large relative changes.

Also when scrolling back through the data I'd like to show the full scale of the data ideally. But even as is with the extent auto scale I'm having trouble getting it to reautoscale on the extent when the user manually scrolls back. But this is not an issue if I could get full scale Y of all data all the time. In realtime mode and manual scrolling.

mswlogo

10 Posts

Posted - 06 Jun 2007 :  12:54:37  Show Profile  Reply with Quote
FYI: I could not edit my own post for some reason. I forgot to finish subject line.

Anyway regarding the last part of my question I got manual scrolling to do full scale. Still can't get full scale on real time updates in RT_FIXEDEXTENT_MOVINGSTART_AUTOSCROLL mode.
Go to Top of Page

mswlogo

10 Posts

Posted - 06 Jun 2007 :  12:57:40  Show Profile  Reply with Quote
FYI, Strange I can edit my reply but I can't edit my initial post.
Go to Top of Page

n/a

1 Posts

Posted - 06 Jun 2007 :  13:01:09  Show Profile  Reply with Quote
I don't agree with your premise that the current ScrollFrame auto-scaling mode is useless. My long experience shows that the way it is implemented is what most programmers want.

You can implement what you describe easily enough. Turn off the auto-y scaling of the scroll frame.

scrollFrame.ScrollScaleModeY = ChartObj.NO_AUTOSCALE;

Then keep track of the maximum y-value you want the y-scale to auto-scale against, probably in the routine you use to update the RTProcessVar objects.

private void timer1_Tick(object sender, System.EventArgs e)
{
  if (this.IsDesignMode) return;			
		
// Random data
  currentTemperatureValue1 += 5 * (0.5 - ChartSupport.GetRandomDouble());

  // maxy is a double global to the entire class
  maxy = Math.Max(currentTemperatureValue1, maxy);

  // This method uses the default time stamp, which is the current time-of-day
  currentTemperature1.SetCurrentValue(currentTemperatureValue1);

}


Then, if the ymax value changes, adjust the y-scale and axes each time you do an update.

private void timer2_Tick(object sender, System.EventArgs e)
{
  if (this.IsDesignMode) return;			
  this.UpdateDraw();	
  if (scrollFrame.ChartObjScale.ScaleStopY != maxy)
  {
    scrollFrame.ChartObjScale.ScaleStopY = maxy;
    scrollFrame.RescaleAxesToCurrentTransform();
  }
}


You can make it fancier by tracking more variables, but the concept is the same.

Edited by - n/a on 06 Jun 2007 13:02:06
Go to Top of Page

mswlogo

10 Posts

Posted - 06 Jun 2007 :  14:23:06  Show Profile  Reply with Quote
Thanks !!! I'll give it a whirl.

It would be nice to add RT_AUTOSCALE_Y_MINMAX_FULLDATASET. Or perhaps a seperate option because it could be used in combination with several of the AUTOSCALE_Y options.

There are certainly applications where what you have makes sense. But I think there are just as many you want full auto scale.

For us all it ever shows is the noise at that level unless it just transitioned. But once the transition is out of the extent it jumps back to noise again. Looks the same if it's high or low.

Go to Top of Page

quinncurtis

1586 Posts

Posted - 06 Jun 2007 :  14:33:40  Show Profile  Reply with Quote
Thank you for your suggestion. We will add it to the list of new features to consider in future revisions. If you would like to have that feature added immediately to the software, contact our special services group at sales@quinn-curtis.com and they will give you a quote.
Go to Top of Page

mswlogo

10 Posts

Posted - 06 Jun 2007 :  15:15:21  Show Profile  Reply with Quote
It worked had to recalc Axis too.

public void AddDataPoint(long acquisitionNumber, double totalIonCurrent)
{
lock (mDataset)
{
mDataset.SetCurrentValue((double)acquisitionNumber, totalIonCurrent);
}

if (myMin > totalIonCurrent)
myMin = totalIonCurrent;

if (myMax < totalIonCurrent)
myMax = totalIonCurrent;

if ((mScrollFrame.ChartObjScale.ScaleStartY != myMin) || (mScrollFrame.ChartObjScale.ScaleStopY != myMax))
{
mScrollFrame.ChartObjScale.ScaleStartY = myMin;
mScrollFrame.ChartObjScale.ScaleStopY = myMax;
mScrollFrame.RescaleAxesToCurrentTransform();
myAxis.CalcAutoAxis();
}
}
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