hide the scroll bars in RadCartesianChart

5 posts, 1 answers
  1. Александр
    Александр avatar
    1 posts
    Member since:
    Oct 2015

    Posted 29 Oct 2015 Link to this post

    Hello.
    I use the <telerik:ChartPanAndZoomBehavior DragMode="Pan" PanMode="Both" ZoomMode="Both" /> for scaling the RadCartesianChart.
    How I can hide the scroll bars?
  2. Answer
    Dinko
    Admin
    Dinko avatar
    266 posts

    Posted 30 Oct 2015 Link to this post

    Hello Александр,

    You can hide the vertical and the horizontal scroll bar of the RadChartView by applying an implicit Style to the PanZoomBar like so:

    <telerik:RadCartesianChart >
               <telerik:RadCartesianChart.Resources>
                   <Style TargetType="telerik:PanZoomBar">
                       <Setter Property="Visibility" Value="Collapsed"/>
                   </Style>
               </telerik:RadCartesianChart.Resources>

    I have attached a sample project where you can see this implemented. Give it a try and let me know if this is the solution you are looking for.

    Regards,
    Dinko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Yaroslav
    Yaroslav avatar
    144 posts
    Member since:
    Jan 2016

    Posted 28 Sep 2016 in reply to Dinko Link to this post

    Nice solution! Finally I found the solution to my problem similar by this post.
  4. Philip
    Philip avatar
    15 posts
    Member since:
    Mar 2015

    Posted 24 Jan in reply to Dinko Link to this post

    I wonder if the style is missing BasedOn="{StaticResource PanZoomBarStyle}"

    It doesn't matter if you just want to hide it, but I think it's needed if you want to toggle visibility etc.

  5. Martin
    Admin
    Martin avatar
    1219 posts

    Posted 27 Jan Link to this post

    Hello Philip,

    The BasedOn attribute is required for custom styles only when using NoXaml dlls and the Implicit Styles theming mechanism. For more information about this see the Setting a Theme and Styling Controls help articles.

    If you are not using NoXaml dlls you can skip setting the BasedOn property. Actually, in this scenario if you set the property, an exception will be thrown because the inherited Style won't be found.

    If you are using NoXaml dlls and skip setting the BasedOn property, the custom style will completely override the default style of the control. This includes also its Template. Which means nothing will be displayed.

    Regards,
    Martin
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top