Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Show scroll bars when Zooming In
posted

I want to have the scroll bars hidden when the zoom is the default (100%), but when the user zooms in I want the XamDataChart to show the scroll bars. I do not know if there is an event that I can use or if it is a default feature in this control.

Parents
No Data
Reply
  • 30692
    Verified Answer
    Offline posted

    Yes, you can use the ActualWindowRectChangedEvent:

    https://gist.github.com/gmurray81/0be8af59bc93e515be70

            public MainWindow()
            {
                InitializeComponent();
    
                chart.ActualWindowRectChanged += chart_ActualWindowRectChanged;
            }
    
            void chart_ActualWindowRectChanged(object sender, Infragistics.RectChangedEventArgs e)
            {
                if (e.NewRect.Width < 1.0 ||
                    e.NewRect.Height < 1.0)
                {
                    chart.HorizontalZoombarVisibility = System.Windows.Visibility.Visible;
                    chart.VerticalZoombarVisibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    chart.HorizontalZoombarVisibility = System.Windows.Visibility.Collapsed;
                    chart.VerticalZoombarVisibility = System.Windows.Visibility.Collapsed;
                }
            }
    

    Hope this helps!

    -Graham

Children