- Home
- Forum
- Xamarin.Forms
- Opposed secondary axis scale not correct
Opposed secondary axis scale not correct
I need a secondary axis on the right hand side, with the same settings (min, round style, etc.) as the first secondary axis.
I have added an opposed secondary axis with the same settings as the main secondary axis (apart from OpposedPosition and IsVertical).
However, the opposed secondary axis does not have the correct round or maximum setting. See screenshot.
Reproduction solution attached - only the iOS project is needed to demonstrate it.
Attachment: SecondaryAxisDemo_84b449e6.zip
|
…
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis x:Name="MainSecondaryAxis"
Minimum="0"
RangePadding="Round" />
</chart:SfChart.SecondaryAxis>
<chart:SfChart.Axes>
<chart:NumericalAxis
Name="OpposedSecondaryAxis"
OpposedPosition="True"
IsVertical="True"
Minimum="{Binding Source={x:Reference MainSecondaryAxis}, Path=VisibleMinimum}"
Maximum="{Binding Source={x:Reference MainSecondaryAxis}, Path=VisibleMaximum}"
RangePadding="Round" />
</chart:SfChart.Axes>
… |
Thank you - I can see the logic being used in the solution.
The sample works on Android, but on an iOS Simulator (an iPhone 11 running iOS 14) the app does not start up fully. It gets to the splash screen and hangs.
I cannot see any errors in the application output or console.
Can you confirm that you have run the sample on an iOS simulator?
Regards,
James
Sorry for the inconvenience caused in iOS platform.
|
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis x:Name="MainSecondaryAxis"
Minimum="0"
RangePadding="Round"
ActualRangeChanged="MainSecondaryAxis_ActualRangeChanged"/>
</chart:SfChart.SecondaryAxis>
<chart:SfChart.Axes>
<chart:NumericalAxis x:Name="OpposedSecondaryAxis"
OpposedPosition="True"
IsVertical="True"
RangePadding="Round" />
</chart:SfChart.Axes> |
|
private void MainSecondaryAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
OpposedSecondaryAxis.Minimum = (double)e.ActualMinimum;
OpposedSecondaryAxis.Maximum = (double)e.ActualMaximum;
} |
- 3 Replies
- 2 Participants
-
JL James Lavery
- Sep 26, 2021 03:06 PM UTC
- Sep 28, 2021 11:44 AM UTC