Pre loader

Tag: MouseWheel

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 votes

I know that when I use MouseWheelZoomModifier with my chart surface, the default behavior is:
1. On mouse wheel (No keyboard mod) – Zoom according to the “ActionType” propery, and direction according to the “XYDirection” property.
2. On mouse wheel + CTRL – X-Axis pan
3. On mouse wheel + Shift – Y-Axis pan

I want to achieve this behavior:
1. On mouse wheel (No keyboard mod) – Zoom according to the “ActionType” propery, and direction according to the “XYDirection” property.
2. On mouse wheel + CTRL – XY-Axis Zoom
3. On mouse wheel + Shift – Y-Axis Zoom

Any idea how to achieve this behavior?
Thanks, Ben.

  • Ben Mendel asked 2 months ago
  • last active 1 month ago
1 vote

How do I implement mouse wheel zooming so that the point under the mouse pointer (before zoom), will also be under the mouse pointer after the zoom?
The chart is a 2D chart with DateTime X axis and multiple value Y axes.

1 vote

I want to implement a behavior on all axes with a mouse wheel. After quite some searching and trying I came up with a solution (possibly?).
In my control there are dynamically created one x-axis and several y-axes on one or more charts in a chartgroup.

But from the samples I get the impression the standard way would be to use a Modifier or a behavior like XAxisDragModifier (which does not use Wheel). And all tries to use a modifier did not work (for different reasons see below for some. One also is that I am getting more and more modifiers and they start to interfere with each other – like wheel on center area).

What am I trying to do and how do I think I could solve it “non-standard” way:

User Story:
User wants to change zoom (or pan) via mousewheel on axis.
Details just for info. Complete user story:
User can click on Axis to select it (it gets highlighted or border around it) and then the user can change via MouseWheel the Zoom or Pan.
Selecting Pan is done by pressing CTRL Key while mousewheel use. Otherwise zoom.

Possible Solution:
How do I think I could solve the mousewheel event capture:
Create a custom Axis:

public class CustomAxis : NumericAxis
    protected override void OnMouseWheel(MouseWheelEventArgs e)
        e.Handled = true;
        // Do zooming or paning


Other options I ruled out:
Why can’t i use XAxisDragModifier? Besides it does not work with wheel: It does not work for me at all. Probably because my X-Axis has an ID. But that I don’t have during compile-time. So I cannot assign it. So my XAxisDragModifier does nothing.
Why do I not use YAxisDragModifier? Same problem. Several (unknown number) of YAxes with IDs i don’t have at compile time. I would have to add them at runtime. I have a custom behavior linking VMs to Axes and creating them. But debugging shows me that the Modifiers are not available at that time so I cannot add one.

Could this work? Or is there an obvious reason not to do it this way?
I would have to do the zoom and pan functions myself (I hope I can at this place)and I am using a custom ViewportManager as well.

  • Uwe Hafner asked 9 years ago
  • last active 2 years ago
Showing 3 results