Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
Doing zoom out instead zoom in based on drag dirction
posted

I would like to implement a functionality what some tools implement: zooming in the direction (in or out) based on drag direction.

I mean would like to keep the zoom in functionality exactly unchanged in case the drag direction is from upper,left -> bottom, right

but zoom out if the drag direction was upper,left -> bottom, right->upper,left. I know the question rises: zoom out with what zoom state, but starter I would be happy just zooming out with a fixed way just like pgup/pgdown keys do.


Thanks in advance

Parents
No Data
Reply
  • 34510
    Offline posted

    Hello Justin,

    The XamDataChart has properties called WindowScaleHorizontal and WindowScaleVertical which are used to control the zoom level of the chart both horizontally and vertically.  These properties are settable so you can change them however you'd like.

    The only issue I see with your requirement is that you say you want to keep the default interaction of click and dragging from the top left to the bottom right.  I assume you are talking about the rectangle highlight that appears?  That rectangle is strictly meant for highlighting the area of the chart that you wish to zoom in on.  What I imagine you would have to do is disable this functionality and then implement your own mouse tracking via the mouse events and then adjust the WindowScaleHorizontal/WindowScaleVertical properties accordingly.

Children