0

I am new to ZedGraph, however I managed to create simple chart and enabled scrolling along the x axis. My problem is that I cant figure how to force the Y axis to autoadjust to show the whole section of the curve. Graphically depicted I want instead of this

          _______________________
          |                     |
          | \            _______|
          |  \          /       |
          |___\________/________|
               \______/ 

to adjust the Y axis (or to pan the chart) to look like this

          _______________________
          | \            _______|
          |  \          /       |
          |   \        /        |
          |____\______/_________| 

where the inside of the rectangle is what is visible.

I thought that

myPane.YAxis.Scale.MinAuto = true;
myPane.YAxis.Scale.MaxAuto = true;
myPane.IsBoundedRanges = true;

should force the axis to behave like I described, but appratenly not.

m3div0
  • 1,556
  • 3
  • 17
  • 32

1 Answers1

0

According to this documentation, you'll want to set

myPane.IsBoundedRanges = false;

...which tells ZedGraph to use all Y values to set the Y-axis scale, rather than just the Y values for points whose X values are currently scrolled to be visible.

adv12
  • 8,443
  • 2
  • 24
  • 48
  • Actually I want the Y axis to adjust for the points whose X are currently visible. Lets say that I have points (1,9)(2,8)(3,7)(4,6)(5,5) and on the X axis there are currently points 1,2,3 visible, so I want to have points 9,8,7 on the Y axis and nothing more. When I scroll to 2,3,4 on x axis, I want the y axis to shift to 8,7,6 and so on. – m3div0 Sep 21 '15 at 22:00