ZedGraph Zooming And Resizing

独自空忆成欢 提交于 2019-12-23 17:26:12

问题


When I draw a graph, and zoom in and out of it, and redraw it, the location of the graph doesn't change.

What I want to be able to do is have the view change to see all of the graphed data whenever the data is redrawn. This seems to be disabled if you zoom in or out before redrawing.

Thanks!


回答1:


Set the property .IsZoomOnMouseCenter to true for the control:

zedGraphControl1.IsZoomOnMouseCenter = true;

Also you may want to change the settings for horizontal and/or vertical zoom, in case you want to allow the graph to only zoom (stretch) along one axis:

// Enable only horizontal zoom/stretch
zedGraphControl1.IsEnableHZoom = true;
zedGraphControl1.IsEnableVZoom = false;



回答2:


Use a Zedgraph method: // Restores the scale ranges to the values before all zoom and pan operations zg1.ZoomOutAll(GraphPane);



来源:https://stackoverflow.com/questions/5266275/zedgraph-zooming-and-resizing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!