c# - ZedGraph how to detect zoom in or out? -


i have been using zedgraph while frustrated after hours of search couldn't find how distinguish detect if zoom event "zoom in" or "zoom out" or "zoom out?

actually i'mm making own version of zoom in , out sampling specific data in each case , need find way detect type of zoom event.

if 1 has idea, please me out.

thanks.

earlier detecting zoom in or out checking if zedgraphcontrol1.graphpane.xaxis.scale.max value less number of points in chart. if less zoom in intended , vice versa. not fool proof zoom out detected zoom in.

after search found this: http://sourceforge.net/p/zedgraph/discussion/392232/thread/d33cfd8c/

so using similar technique improved detection calculating area of selected zoom area when user zooms in using left-click , drag (using new values of zedgraphcontrol1.graphpane.xaxis.scale.max , zedgraphcontrol1.graphpane.xaxis.scale.min ) , comparing area area of whole chart (using previous values of zedgraphcontrol1.graphpane.xaxis.scale.max , zedgraphcontrol1.graphpane.xaxis.scale.min).

like here:

private void zedgraphcontrol1_zoomevent(zedgraphcontrol sender, zoomstate oldstate, zoomstate newstate) {      if (((lastyaxismax - lastyaxismin) * (lastxaxismax - lastxaxismin)) > ((sender.graphpane.xaxis.scale.max - sender.graphpane.xaxis.scale.min) * (sender.graphpane.yaxis.scale.max - sender.graphpane.yaxis.scale.min)))     {         zoomin = true;         zoomout = false;     }     else     {         zoomin = false;         zoomout = true;     } } 

that's disappointing know there no simple way far working fine because users selected area cannot equal or greater chart area.

hope helps someone.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -