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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Anyone please do help me?
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.
"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
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).
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??
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.
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..
i'm confused about it... could you provide me with an example please?