Pre loader

Xamarin.iOS: Forced width of Y axes

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

Currently we have two graph surfaces with two Y axes on each side and we need all of the Y axes to have fixed width size. Until now we were achieving that like this:
topGraphSurface.LeftAxisAreaForcedSize = 45;
topGraphSurface.RightAxisAreaForcedSize = 45;
bottomGraphSurface.LeftAxisAreaForcedSize = 45;
bottomGraphSurface.RightAxisAreaForcedSize = 45;

but since updating to the new SciChart v3 we get the error “SciChartSurface does not contain a definition for (Left)AxisAreaForcedSize”. I couldn’t find any information about this in the Migration guide, so is there a way to achieve this in the new version?

Version
3.1.0.4942
  • You must to post comments
0
0

Hi Martina.
To force axis labels to have a fixed number of characters you can use Axis.textFormatting property. More here
See also Multi-Panel Stock Chart example where this approach has been implemented.
Let us know if that helped.

  • You must to post comments
0
0

Hi, Martina.

Can I ask you what is the purpose of hardcoding AxisAreaForcedSize to exactly 45? In v.3 the Axis area is calculating automatically based on axis title, tick labels, etc.

If you want to layout two charts you can use SCIChartVerticalGroup. See example Multi-Panel Stock Chart

If you want to add some padding to your axis you can use axis.axisTickLabelStyle property as described here:

If you want to have some custom axis layout you can play with the layout manager as described here:

Let us know more details about your requirements. And if it is possible, please provide some test example so we stay on the same page trying to help you.

  • Martina Papaliska
    Hi Andriy, thank you for your answer. To give you a better understanding of the issue that we have and why we chose that approach as a solution I’m sending you a link to a question on this forum that we asked about 2 years ago: https://www.scichart.com/questions/ios/xamarin-ios-fixed-width-of-axes Basically when zooming in or out, the axis’ label would have different number of characters (zooming really deep would have 1 character for example and zooming out would have 3-4 characters) making the width of the axis change corresponding to the number of characters on the label which can then change the size of the graph area and look like the two graphs have a different width. That’s why we needed to have one fixed size of the axes (in our case 45 worked) so that no mater how much we zoom in or out, and what the characters on the axis label are we would always have the same size for all 4 axes.
  • 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