Menu

Regarding Zoom function

Help
marlboro
2009-07-28
2012-09-19
  • marlboro

    marlboro - 2009-07-28

    Hi,
    I have 2 questions:

    1) i have 2 zedgraph e.g. zg1 and zg2 (both not the masterpane)
    How to zoom together i.e. while i zoom the zg1, the zg2 will follow the zooming of zg1.

    2) How to control the zoom factor...meaning when i drag my mouse once... it will only zoom for 10X instead of the size of my mouse drag?

    Please guide.
    Thank you.

     
    • marlboro

      marlboro - 2009-07-30

      Anyone please do help me?

       
    • Gacek

      Gacek - 2009-07-30

      Regarding your first question, I think you need to subscribe to Zoom event of both zg1 and zg2 and call inside the zoom handler of second control.

       
      • marlboro

        marlboro - 2009-07-30

        "subscribe to Zoom event of both zg1 and zg2 and call inside the zoom handler of second control"
        Could you please guide me how to do that please? any example? Thanks

         
    • Gacek

      Gacek - 2009-07-31

      Here you can read a little about subscribing to events and handling them.

      To subscribe to ZoomEvent use:
      zg1.ZoomEvent += new ZedGraphControl.ZoomEventHandler(zg1_ZoomEvent);

      then inside the handler:

      void zg1_ZoomEvent(ZedGraphControl sender, ZoomState oldState, ZoomState newState)
      {
      // here you can add the code you need.
      }

      You do the same thing for second control. The only thing I cannot help you with is how to force the zg2 zoom event from inside of the zg1_ZoomEvent handler (and in second way as well).

       
    • onur ozturk

      onur ozturk - 2009-07-31

      hello there!

      Can you give more specific information about your problem, for example axis type(date,linear?) in both zgcontrol?

      I do not know your problem but maybe Scaling XAxis values may help you...

      I must know if you can make a comparison between the axis values in zedgraph controls??

       
      • marlboro

        marlboro - 2009-07-31

        i know that there is an example on masterpane with three synchronized vertical panes where it could zoom all the three panes simuteneously when i drag my mouse on any of one pane.

        For my case, i have to create 2 zgcontrol; both zgcontrol have identical XAxis values; when i drag my mouse to zoom for anyone of them they will both to be zoomed.

        Besides, could anyone tell me how to control the amount of zoom by dragging mouse over the pane e.g drag one time it will zoom into 10X instead of size of area of the mouse dragging.

         
        • onur ozturk

          onur ozturk - 2009-08-02

          maybe you can do that by changing XAxis.Scale.Min & XAxis.Scale.Max by capturing Zoom event of zedgraph control.when zedgraph zoomed or panned.. OR you can disable all zoom options of zedgraph control and enable only selection rectangle ..this only shows a selection rectangle on zedgraph control but not zoom .in this way you must deal with mouse events as i do and in your MouseUp event you must scale the axis ranges by using XAXİS:SCALE:Min and Max..I used it while printing it worked...Maybe helps to you..

           
          • marlboro

            marlboro - 2009-08-02

            i'm confused about it... could you provide me with an example please?

             

Log in to post a comment.

MongoDB Logo MongoDB