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

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
asimon
Newbie
Newbie
Posts: 3
Joined: Mon Nov 28, 2011 12:00 am

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

Post by asimon » Mon Oct 29, 2012 2:10 pm

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

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

Post by Sandra » Tue Oct 30, 2012 9:23 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply