title: How to draw rectangular profiles using x and y coordinate array?
body: <p>To handle collision prevention, for example, I set the program to issue a warning when near to obstacles. The x and y coordinates of obstacles are put into array.</p>
  
  <p>Now I would like to draw a smooth profile that is like blocks of rectangles.
  However, I get slanted lines whenever there is change in y-coordinate.</p>
  
  <p>A small part of the code I used are as followed, assuming the coordinates of x and y arrays should give rectangular shaped profile with rises and falls as x changes, maybe like building a castle with some variation in height y.</p>
  
  <pre><code>for (int i = 0; i &lt; Copy_length; i++)
          {
              chart1.Series["Series1"].Points.AddXY(X[i],Y[i]);
  
          }
          chart1.Series["Series1"].Color = Color.FromArgb(100, Color.Olive);
  
          chart1.Series["Series1"].Points.DataBindXY(X, Y1, Y2);
  </code></pre>
  
  <p>Other suggestions for handling of collision prevention are welcome too.</p>