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

Disable parent ScrollViewer when scrolling in SfChart

Thread ID:

Created:

Updated:

Platform:

Replies:

143511 Mar 24,2019 04:51 PM UTC Mar 25,2019 10:28 AM UTC UWP 3
loading
Tags: SfChart
Alexander
Asked On March 24, 2019 04:51 PM UTC

Hello,

I'm using a SfChart which is embedded in a ScrollViewer. The SfChart has Zoom Behavior enabled like this:

<sfchart:ChartZoomPanBehavior ResetOnDoubleTap="True" EnableMouseWheelZooming="True" EnablePinchZooming="True" ZoomRelativeToCursor="True" ZoomMode="X"/>

I noticed, that when I'm zoom-scrolling in the SfChart, the ScrollViewer also scrolled up and down.
Is there a possibility to disable the ScrollViewer while the mouse is active within the SfChart?

Greetings
Alexander

Muneesh Kumar G [Syncfusion]
Replied On March 25, 2019 05:56 AM UTC

Hi Alexander,   
 
Greetings from Syncfusion, we have analyzed your required requirement and you can achieve this by raising PointerWheelChanged event in SfChart and set e.Handled as true as per the below code snippet.  
 
Code snippet 
  <ScrollViewer > 
            <StackPanel> 
                 
            <chart:SfChart x:Name="chart1" Height="600" Margin="50,5,50,5" PointerWheelChanged="ScrollViewer_PointerWheelChanged"> 
             
.. 
        </chart:SfChart> 
 
                <chart:SfChart x:Name="chart2" Height="600" Margin="50,5,50,5" PointerWheelChanged="ScrollViewer_PointerWheelChanged"> 
 
                    .. 
                </chart:SfChart> 
 
 
            </StackPanel> 
        </ScrollViewer> 
 
public sealed partial class MainPage : Page 
    { 
        public MainPage() 
        { 
            this.InitializeComponent(); 
        } 
 
        private void ScrollViewer_PointerWheelChanged(object sender, PointerRoutedEventArgs e) 
        { 
            e.Handled = true; 
        } 
    } 
 
We have prepared a sample based on this, please find the sample from the following location.  
 
 
Please let us know if you have any queries.  
 
Thanks,  
Muneesh Kumar G.  
 


Alexander
Replied On March 25, 2019 10:07 AM UTC

Thank you very much, this worked.

Muneesh Kumar G [Syncfusion]
Replied On March 25, 2019 10:28 AM UTC

Hi Alexander,   
 
Thanks for the update. 
  
We are glad to know that the given solution works. Please let us know if you need any further assistance. 
 
Thanks,  
Muneesh Kumar G.  
 


CONFIRMATION

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

;