Pre loader

Tag: YAxisDragModifier

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

1 vote
5k views

I am trying to implement the following functionality requested by our users:

Zoom:
– Only zoom the chart when using CTRL + MouseWheel key
– This is similar to how most browsers behave

Pan/Scroll:
– If no CTRL key is pressed, then pan/scroll
– This is similar to how most browsers behave

Given the above requirement, I started by creating custom modifier by extending YAxisDragModifier.

My code almost works:
– When using CTRL + Mouse Left & Drag, it Scales (zooms) — just like the user wants
– But using CTRL + Mouse Wheel does not do the same — it only Scales (Zooms).

I have uploaded the code at codesandbox.io:
https://codesandbox.io/s/amazing-shape-2ispt0?file=/src/customModifiers.ts

Note that I have not tried to implement this in ZoomPanModifier yet, but would be helpful if you could give me some pointers on getting this feature in there too.

I would appreciate any help I can get and thanks a bunch in advance.

Best Regards,
Sachin Patel.

0 votes
12k views

Hello, I have added YAxisDragModifier and ZoomPanModifier to my surface and when I try to drag on Y axis I can move the X axis too and that is not the behavior that I was trying to get. I want when I drag/move YAxis not to move on the YAxis also.

Here is my code:

Surface.ChartModifiers.Add(new PinchZoomModifier());
Surface.ChartModifiers.Add(new ZoomExtentsModifier());
Surface.ChartModifiers.Add(new YAxisDragModifier { DragMode = AxisDragModifierBase.AxisDragMode.Pan });
Surface.ChartModifiers.Add(new XAxisDragModifier { DragMode = AxisDragModifierBase.AxisDragMode.Pan, ClipModeX = ClipMode.None });
Surface.ChartModifiers.Add(new ZoomPanModifier
{
Direction = Direction2D.XDirection,
ZoomExtentsY = false
});

Here is the video with the behavior:
VIDEO: https://drive.google.com/file/d/1kbYi2voKNvHD5J7D6-XDw7OJx4IwlEqr/view

Help please!

Showing 2 results

Try SciChart Today

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

Start TrialCase Studies