We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to customize the axis range based on condition

In SfChart, the minimum and maximum ranges of an axis are calculated automatically based on the provided data. You can also set its range explicitly using the Minimum and Maximum properties of the respective axis.

There might be situation in which you need to have the control over the auto-calculated range. At this situation, you can subscribe the ActualRangechanged event of the respective axis and modify the auto-calculated minimum and maximum values that you got in the event arguments. This event will be fired whenever the actual range of the corresponding axis changes.

In the following code example, the maximum visible range is always kept to 80 whenever the overall range of the axis exceeds 80,

[C#]

 

[XAML]

 

[C#]

 

 

                                                          

Output:

C:\Users\yuvaraj.palanisamy\Pictures\android1.png

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5546 11/03/2015 03/05/2018 Xamarin.Forms SfChart
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.