SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

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.