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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Showing the first few bars in sfchart and enable scrolling to see the rest

Thread ID:





130989 Jun 15,2017 12:03 AM UTC Jun 19,2017 05:46 AM UTC Xamarin.Forms 3
Tags: SfChart
Naveen C Ramachandrappa
Asked On June 15, 2017 12:03 AM UTC


I referred the below link.


But with this it always shows the last set of bars . However, I want to show the first few bars based on the number specified and enable scrolling to see the bars on the right.

Is it possible?

Saravana Pandian Murugan [Syncfusion]
Replied On June 15, 2017 11:28 AM UTC

Hi Naveen, 
Thanks for using Syncfusion products. 
You can achieve this requirement by using ZoomFactor/ZoomPosition of ChartAxis. Please find the code snippet below. 
Code Example: 
chart.PrimaryAxis = new CategoryAxis() 
                ZoomFactor = 0.5, 
                ZoomPosition = 0       
ZoomFactor defines the percentage of visible range from the total range of axis. For instance, when the Range is from 0 to 100 and ZoomFactor is 0.5, the visible range will be 0 to 50 or 50 to 100 (the start of the range will be determined by ZoomPosition).  
ZoomPosition defines the start of the range of values that need to be displayed as a result of ZoomFactor. For the above scenario, when the ZoomPosition is 0.25 then the visible range will be from 25 to 75. 
Note: The sum of ZoomFactor and ZoomPosition must also fall within the value of 0 to 1. 
We have attached a sample for your reference which can be downloaded from the below location. 
Please check the sample and let us know if you need further assistance on this. 
Saravana Pandian M. 

Naveen C Ramachandrappa
Replied On June 16, 2017 08:46 PM UTC


Thanks for the info. I have an additional question.

Let say I have 8 bars and I show only 4 bars when the chart comes up using the zoom factor and zoom position.

If I try zooming out completely, I will end up seeing all the 8 bars but I want to restrict user to see only 4 bars at the max when he tries to zoom out and to see the rest he has to scroll. At no point in time, I want him to see more than 4 bars. So, I want to lock user on zoom out . Is there a way to achieve this?

Parthiban Sundaram [Syncfusion]
Replied On June 19, 2017 05:46 AM UTC

Thanks for the update. 
Please find the below code snippet to lock the Zooming.  
Code Snippet: 
                EnableDoubleTap = false, 
                EnableZooming = false 
Also, we have modified the sample based on your requirement. Please download from following location. 
Please let us know, if you need further assistance on this.  
Parthiban S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon