Pre loader

How to create Symmetrical XY axis system

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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

Version
6.2.1.13304
Images
  • You must to post comments
0
0

We have an example here of how to use the TickProvider API to arrange axis gridlines in a uniform grid.

https://github.com/ABTSoftware/SciChart.Wpf.Examples/tree/SciChart_v6_Release/Sandbox/CustomerExamples/TicklinesUniformGrid

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

  • You must to post comments
0
0

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

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies