I am trying to show a 2D Scatter series having 4 points that form a square. Like (0;0), (1;0), (1;1) and (0;1). Is there a way to tell the chart to keep this thing square when I resize the surface, use zoom extent, rubber zoom etc? I basically need X/Y ratio to be fixed.
Hi Andrew, thank you for your answer, but what I am trying to achieve is different. I am displaying a simple 4-point scatter series.
Currently, if I resize the window, it behaves like this:
What I want to achieve is this:
So that square stays square when I resize the surface or use rubber band to zoom a part of it. ZoomExtents should also keep the X/Y ratio while also respecting GrowBy etc. Just like when you zoom a drawing in autocad or any other editor. I.e, 0 to 1 by X should have the same pixel size as 0 to 1 by Y.
I could of course bind Surface’s Width and Height together, as you suggested but this is not what desired. Either cropping or letterboxing would occur in this case, which I am trying to avoid.
Thanks for your help!
Since its WPF, just put the SciChartSurface control inside a container which has a fixed aspect ratio.
Thanks for the excellent explanation Valeriy
I’m afraid we don’t support this in SciChart nor have any example how to do it, however I think it can be achieved.
1.) You will need to listen to the SciChartSurface.SizeChanged event
2.) You will need to get the SciChartSurface.RenderSurface.ActualWidth and ActualHeight
3.) You will need to compute the XAxis.VisibleRange as a ratio of the YAxis.VisibleRange to ensure that the aspect ratio stays the same
Please try that, let me know if it helps
Please login first to submit.