Page 1 of 1

How to fix the pint of origin in the middle of the c-system?

Posted: Mon Oct 29, 2012 2:10 pm
by 15660870
Hi guys,

short question:
How can i fix the point of origin in the middle of the cartesian coordinate-system? I am using the Fastline type to display a relative function, but the axis are not fixed at their zero points, so the view is very bad.

Regards
Alexander

Re: How to fix the pint of origin in the middle of the c-system?

Posted: Tue Oct 30, 2012 9:23 am
by 10050769
Hello asimon,

I suggest you use method SetMinMax to modify the scale of axes as I do in next code:

Code: Select all

private Steema.TeeChart.Styles.FastLine fastLine1;

      public Form1()
      {
         InitializeComponent();
         InitializeChart();
      }
      private void InitializeChart()
      {
          fastLine1 = new FastLine(tChart1.Chart);
          Random rnd = new Random();
          for (int i = 0; i < 10; i++)
          {
              if(i==0)
              {
                  fastLine1.Add(0,0);
              }
              else
              {
              fastLine1.Add(i, rnd.Next(10));
              }
          }
          tChart1.Axes.Left.SetMinMax(-(fastLine1.YValues.Maximum),fastLine1.YValues.Maximum);
      }
Could you please, tell us if previous code works as you want?

I hope will helps.

Thanks,