Zed-Graph Set the default scale programmatically

I have a winforms application that uses the zed-graph library for graphing. When I right-click on a control (while the application is running), a context menu appears and I can choose Set Scale to default .
How to achieve this Set Scale to default -behavior programmatically?

+4
source share
2 answers

The following code is executed for each x and y axis:

 _scale._minAuto = true; _scale._maxAuto = true; _scale._majorStepAuto = true; _scale._minorStepAuto = true; _crossAuto = true; _scale._magAuto = true; _scale._formatAuto = true; 

For more information, read the source code easily and search for "Set default scale."

+6
source

As of 2014, I could not get the above solution to work in VS2008, C #. But I managed to do the following:

  private void frmGraph_VisibleChanged(object sender, EventArgs e) { ZGraphComponent.RestoreScale(ZGraph.GraphPane); } 

In the "VisibleChanged" event handler for the window containing the graph component, I call the "RestoreScale" method on the graph component, passing the main panel of the graph as an argument.

+4
source

All Articles