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#)
 RescaleAxesToCurrentTransform - changed behavior?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

findejs

12 Posts

Posted - 18 Apr 2006 :  12:59:46  Show Profile  Reply with Quote
I need to rescale RT scrolling graph in my project. I'm doing it in this way:
Frame.ScrollScaleModeY = GraphObj.RT_NO_AUTOSCALE_Y;
Transform.ScaleStartY = LowRange;
Transform.ScaleStopY = HighRange;
Frame.RescaleAxesToCurrentTransform();

Unfortunatelly, the axes are not rescaled as I expected; the axes are painted outside the transform. I recompiled the Polygraph example to check what is wrong, but the Polygraph example has the same incorrect behavior. The original demo, still available on QC web site, works OK. I'm using QCRTGraphNet.dll version 1.6.1.2.
Is it feature or bug? And if it is feature how to achieve the original behavior with the current libraries?
Thanks.

quinncurtis

1586 Posts

Posted - 18 Apr 2006 :  16:55:41  Show Profile  Reply with Quote
We do see something wrong if you use the track bars on the right to adjust the range for one of the graphs. Is this what your are referring to?

Seems like a signficant bug so we will have to resolve it and update the libraries.
Go to Top of Page

quinncurtis

1586 Posts

Posted - 18 Apr 2006 :  17:09:45  Show Profile  Reply with Quote
It turns out that the Polygraph example program was not updated for a change make in the RescaleAxesToCurrentTransform.

We decided that if the scroll frame had the ScrollScaleModeY set to RT_NO_AUTOSCALE_Y, that NO re-scale of the axis should take place, because a re-scale would change the axis tick mark parameters if the programmer initially chose tick mark parameter values different than our default auto-axis routine chooses.

If you want the axes to track the transform when RescaleAxesToCurrentTransform is called, you must set the ScrollScaleModeY property to RT_AUTOSCALE_Y.

Frame.ScrollScaleModeY = GraphObj.RT_AUTOSCALE_Y;

This has the side affect of causing the y-axis to rescale to match the y-data range whenever the scroll frame is updated which is probably what you want anyway.

But just in case you want to use RT_NO_AUTOSCALE_Y, you can just add a call to the axis CalcAutoAxis property after you call RescaleAxesToCurrentFrame, as the code below, a modified method from our Polygraph example program.

		
private void voiceStressGainTrackBar_Click(object sender, System.EventArgs e)
{
  double newgainvalue = voiceStressGainTrackbar.RTValue;
  voiceStressScrollFrame.ChartObjScale.ScaleStartY = 0;
  voiceStressScrollFrame.ChartObjScale.ScaleStopY = newgainvalue;
  // Rescale axes to match new scale
  voiceStressScrollFrame.RescaleAxesToCurrentTransform();
// Left axis
  yaxis51.CalcAutoAxis();
//Right axis
  yaxis52.CalcAutoAxis();
// Must re-establish the x-intercept of the right y-axis
  yaxis52.AxisIntercept = voiceStressScrollFrame.ChartObjScale.ScaleMaxX;
  this.UpdateDraw();
}


Go to Top of Page

findejs

12 Posts

Posted - 19 Apr 2006 :  03:03:33  Show Profile  Reply with Quote
The CalcAutoAxis() method is what I need, because I have to change transform scale manually.
BTW, it is neccessary to call RescaleAxesToCurrentTransform() if the CalcAutoAxis() must be also called?
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