Hello,
How can I make the XY coordinate to be symmetrical and stay
symmetrical also after zooming.
That is including the case the user is zooming by selecting unsymmetrical area (rectangle ).
In symmetrical XY both axis have the same scale, meaning the real distance on the screen of 1 in the X axis is exactly the same as 1 in the Y axis.
One of the results of symmetrical XY axis is the grid lines creates squares instead of rectangles.
See the attached figure for example of symmetrical XY axis.
Regards,
Eyal
- Eyal Nevo asked 3 years ago
- You must login to post comments
Hi Andrew,
I saw the example but this is not what I meant by ‘symmetrical axis system’.
In any case, I manages to do a symmetrical axis system by changing the zoom
according to the window size.
I did the following:
In the window containing the SciChartSurface I added the following functions:
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
{
SetChartVisibleRange();
}
public void SetChartVisibleRange()
{
X_NumericAxisEx.VisibleRange.SetMinMax(0,
GetDiffX((double)Y_NumericAxisEx.VisibleRange.Diff));
}
public double GetDiffX(double diffY)
{
double factor = ChartBinradSci.ActualWidth / ChartBinradSci.ActualHeight;
double diffX = diffY * factor;
return diffX;
}
The Window_SizeChanged is called at startup which make a symmetrical axis system.
Zooming by the wheel doesn’t destroy the symmetry.
For RubberBandXyZoomModifier and ZoomExtentsModifier I override the function PerformZoom.
It seems to work well now.
Best regards,
Eyal
- Eyal Nevo answered 3 years ago
- You must login to post comments
We have an example here of how to use the TickProvider API to arrange axis gridlines in a uniform grid.
This example actually uses the DPI api in WPF to place gridlines exactly 5mm on the screen. Please take a look and adjust it to your needs.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 3 years ago
- You must login to post comments
Please login first to submit.