Pre loader

MouseWheelZoomModifier ClipModeX

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi.

I use MouseWheelZoomModifier. If some modifier key pressed (Ctrl, Shift, Alt) it produces scroll instead of zoom. My X axis is styled as follows:

<Style TargetType="s:DateTimeAxis">
            <Setter Property="TextFormatting" Value="dd-MM-yyyy"/>
            <Setter Property="SubDayTextFormatting" Value="HH:mm:ss"/>
            <Setter Property="AutoRange" Value="Never"/>
            <Setter Property="GrowBy" Value="0.1, 0.1"/>
            <Setter Property="AxisAlignment" Value="Bottom"/>
            <Setter Property="VisibleRangeLimitMode" Value="MinMax"/>
            <Setter Property="VisibleRange" Value="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}, Path=VisibleRangeLimit}"/>
        </Style>

VisibleRangeLimit is set in code behind. So as you can see X axis can not go out of VisibleRangeLimit. So we came to my problem: with MouseWheelZoomModifier if I hold Ctrl button and scrolling, when X axis comes to limit it starts to zoom X axis.
The same happens with ZoomPanModifier, but in ZoomPanModifier it can be disabled by setting ClipModeX=”ClipAtExtents”, so when you approaches to the border and continue panning it simply do nothing – that’s what behavour I need in MouseWheelZoomModifier with Ctlr key pressed. I could not find anything like this in MouseWheelZoomModifier. Any ideas?

Version
6.2.1.13304
  • You must to post comments
0
0

Hi Grigoriy,

This is one of those things that’s really easy to solve if you have the source-code, but not so easy if you don’t.

The MouseWheelZoomModifier calls a function Axis.Scroll and passes in ClipMode.None. I’ve added a property ClipModeX to the MouseWheelZoomModifier and pushed this to Nightly build 6.2.2.13447.

If you try that build, try the new property can you let me know if it solves your problem?

Thanks and regards,
Andrew

  • Grigoriy Vasilchenko
    Hi, Andrew. Where can I get this nightly build from?
  • Andrew Burnett-Thompson
    Hi Grigoriy, sorry I didn’t see this! If you haven’t figured it out yet, nightly builds can be fetched following these steps https://support.scichart.com/index.php?/Knowledgebase/Article/View/17232/37/getting-nightly-builds-with-nuget
  • Grigoriy Vasilchenko
    Hi, Andrew. ClipModeX did the trick for ActionType = Pan. But for ActionType = Zoom I still can zoom out of data and view blank area when data occupies area less than axis VisibleRangeLimit set. So if I zoom out using MouseWheelZoomModifier (ActionType = ActionType .Zoom) and afterwards change ActionType to Pan or use ZoomPanModifier (with ClipModeX = ClipMode.ClipAtExtents) chart blinks and clips to data. I think the root of my problem is improper (in my opinion) behavior of MouseWheelZoomModifier and ZoomPanModifier when ClipModeX = None. In my opinion they should not perform zoom when axis VisibleRangeLimit is reached. Instead they should just do nothing.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies