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

Solar

USA
3 Posts

Posted - 25 Aug 2011 :  09:07:08  Show Profile  Reply with Quote
im working on a real time graph with four y-axes, two on either side of the plot window. All four can be individually set to auto or manual scale. I set the transform to CartesianCoordinates and used SetAxisIntercept for positioning the far left and right y-axes. The scroll frames and polt lines are using a seperate TimeCoordinates transform. This all works well for manual scale. In auto the plot lines scale correctly but the y-axes do not. I use the ChartObj.RT_AUTOSCALE_Y_MINMAX for the RTScrollFrame. I assume tihs happens because the y-axes are on different transforms
then the scroll frame. If I put these axes on a TimeCoordinates transform along with the scroll frame, SetAxisIntercept does not work. When I put the scroll frame and axes on different TimeCoordinates transforms and adjust the SetGraphBorderDiagonal for positioning the axes the plot lines shift over along with the axes.

Thanks

quinncurtis

1586 Posts

Posted - 25 Aug 2011 :  09:49:49  Show Profile  Reply with Quote
A RTScrollFrame can only manage one coordinate system.
Every coordinate system (you have 4 since you have four different y-axes) must use a separate RTScrollFrame. It is not clear if that is what you are doing. See the example RTStockDisplay for an example which uses two RTScrollFrames for two overlaid coordinate systems, with a y-axis on the left and right, and with RT_AUTOSCALE_Y_MINMAX set for both.

Every overlaid coordinate system must use the same positioning rectangle - SetGraphBorderDiagonal. Once you have that setup don't change it.
Go to Top of Page

Solar

USA
3 Posts

Posted - 25 Aug 2011 :  13:06:12  Show Profile  Reply with Quote
There are four seperate scroll frames and four seperate transforms. All of the transforms have the same positioning rectangle coordinates. two of the y-axes are positioned using xaxis.AxisMax and xaxis.AxisMin. The problem im running into is positioning the other two next to the first two. when I use SetAxisIntercept the axis Disappears. I used the same SetAxisIntercept coordinate with a CartesianCoordinates transform and the axes where right where I wanted them. What is the best way to position y-axes on a TimeCoordinates transform that wont be on xaxis.AxisMax or xaxis.AxisMin.

Thanks
Go to Top of Page

quinncurtis

1586 Posts

Posted - 25 Aug 2011 :  14:14:46  Show Profile  Reply with Quote
So, you are saying that this has nothing to do with a scroll frame -correct. It is in the initial setup of the y-axes.

Time values can also be specified using millisecond numeric values. So you must specify a value which is to the left or right of AxisMax or AxisMin.

So if your time axis has an extent of 60 seconds, and you want the offset y-axis about 10% to the left of the AxisMin y-axis, use:

// offset in milliseconds
double offset = 1000 * (60 / 10)
yAxis3.SetAxisIntercept(xAxis1.AxisMin - offset);

The one to the right would be
yAxis4.SetAxisIntercept(xAxis1.AxisMax + offset);

The actual values will depend on your actual graph. But you should get the idea.



Go to Top of Page

Solar

USA
3 Posts

Posted - 31 Aug 2011 :  14:48:25  Show Profile  Reply with Quote
Problem solved. Thanks for the help.
Go to Top of Page

quinncurtis

1586 Posts

Posted - 31 Aug 2011 :  15:08:22  Show Profile  Reply with Quote
A more general way to calculate the offset is to use AxisMin and AxisMax to calculate the axis extent:

// AxisMin and AxisMax are already in milliseconds
double offset =((xAxis1.AxisMax - xAxis1.AxisMin)/ 10)
yAxis3.SetAxisIntercept(xAxis1.AxisMin - offset);

The one to the right would be
yAxis4.SetAxisIntercept(xAxis1.AxisMax + offset);
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