title: Update y-axis maximum in chart
body: <p>my English is not so good so I apologize in advance.<br>
  I tried something with the object <code>Chart</code> in a <code>WindowsFormsApplication</code>.<br>
  I built a program that looks like this:
  <a href="https://i.stack.imgur.com/noCNu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/noCNu.png" alt="enter image description here"></a><br>
  And that is the code:</p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
      {
          chart1.Dock = DockStyle.Fill;
          chart1.Series.Clear();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          chart1.Series.Clear();
          chart1.Series.Add("button1 Series");
  
          for (int i = 1; i &lt;= 100; i++)
              chart1.Series[0].Points.AddXY(i, i * 2);
      }
  
      private void button2_Click(object sender, EventArgs e)
      {
          chart1.Series.Clear();
          chart1.Series.Add("button2 Series");
  
          for (int i = 1; i &lt;= 100; i++)
              chart1.Series[0].Points.AddXY(i, i * 4);
      }
  </code></pre>
  
  <p>When I click the first button (<code>button1</code>), the graph is displayed as I want:
  <a href="https://i.stack.imgur.com/WADvH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WADvH.png" alt="button1"></a><br>
  But if after that I hit the second button (<code>button2</code>), points on the y-axis escape out:<a href="https://i.stack.imgur.com/zfg3v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zfg3v.png" alt="button2"></a>
  <br>
  The maximum of the y-axis (250) stay the same instead change to bigger.<br>
  How can I fix my program so that the graph will not get out of the area?<br>
  Thanks, and sorry again for my English</p>