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
670
Zoom into selection?
posted

Consider the following chart

I want to "zoom into" a selection. Here is what I wish :)

* when user positions the mouse over the chart, there will be a vertical line.
* user will click and select the chart area between 2:00 and 4:00, and release the mouse button
* I need an event that will say start and finish locations.

Is this doable?

Thanks

  • 10880
    Suggested Answer
    posted

    This is essentially all custom code.  You will have to use the mouse events to track when you click and where you release.  You can use these coordinates in the FillSceneGraph event (replacement for the ILayer interface) to figure out the axis ranges.  You can then either modify the axis range or change the zooming on the chart.

    Essentially, you map screen coordinates to axle equivalents.  Then you either modify the scale or the axis range itself.

    I attached a sample I made quite a while ago.  It uses 8.3.  It does zooming based on mousewheel and draws boxes based on mouse movement.  It is not finished but should give you some direction on how to proceed.

    WindowsApplication1.zip