MinimumRangeSpan in PanZoomBar doesn't work

2 posts, 1 answers
  1. Paulo
    Paulo avatar
    2 posts
    Member since:
    Oct 2013

    Posted 02 Mar 2015 Link to this post

    Hello,

    I have a RadCartesianChart with a CategoricalAxis defined for the Horizontal Axis, and i am styling the PanZoomBar the following way:

    <telerik:CategoricalAxis.Resources>
       <Style TargetType="telerik:PanZoomBar">    
         <Setter Property="MaximumRangeSpan" Value="{Binding PanZoomBarMaximumRange, Mode=TwoWay}"></Setter>
         <Setter Property="IsSelectionRangeEnabled" Value="True"></Setter>
       </Style>
    </telerik:CategoricalAxis.Resources>

    The value for MaximumRangeSpan is binded from the View Model and it works as expected, locking the bar to the maximum value.

    But now i need to do the same for MinimumRangeSpan and it doesn't work. The value never gets binded and even when i hard code a double value for this property the PanZoomBar doesn't block to the minimum selection expected, and always allows to zoom to the smallest value.

    Is it possible to try to achieve this behavior?

    PS: I am using Silverlight Q2 2014 binaries.
  2. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 04 Mar 2015 Link to this post

    Hello Paulo,

    The MaximumRangeSpan property of the slider (the one you are able to bind properly) controls how wide the slider can get. Setting it to 0.5 means that the range thumb cannot get larger than half of the slider's size.

    The MinimumRangeSpan property of the slider (the one that doesn't work) controls how small the range thumb can get. Setting it to 0.1 means that it will not get a smaller size than 10% of the slider's size.

    The chart has a top level MaxZoom property. It specifies the maximum a user can zoom in. Setting it to (3, 3) means that the user can zoom in a maximum of three levels. This is equivalent to setting the MinimumRangeSpan of the slider to 0.33. Because the chart is the top level control you use, it sets the MinimumRangeSpan property, based on the value of its MaxZoom property. This is why the binding to MinimumRangeSpan is not respected, the charts sets a local value.

    The suggested way to go is to set a MaxZoom to the chart and not use binding for the MinimumRangeSpan. We have plans on introducing a MinZoom property, so that one can avoid declaring a PanZoomBar style just to get this behavior. I hope this information is helpful.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
Back to Top