Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zedgraph - Set Min/Max values on an axis permanently

I am working on a zedgraph where the Y-axis is a percentage value. I want the min and max values to be 0/100 respectively. I can set this via the GraphPane.YAxis.Scale.Min and Max properties, and this works fine.

However, if the user does the rectangle drag to change the "viewport" of the graph, or zooms in/out, the Y-axis min/max changes. Is there a way I can force the Min/Max values to persist, but still allow the user to zoom / draw the selection box (essentially, allowing them to JUST pan/zoom the x-axis).

I've tried setting MinAuto / MaxAuto, but this seems to have no effect.

like image 620
Stealth Rabbi Avatar asked Oct 08 '22 18:10

Stealth Rabbi


1 Answers

I had the same problem and solved it like this:

zedGraphControl1.IsEnableVZoom = false;
zedGraphControl1.IsEnableVPan = false;

This should only allow Horizontal Zoom.

like image 64
asdasdad Avatar answered Oct 10 '22 07:10

asdasdad