I want to "Set the Bottom Axis to Current Date or Time";but

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ifSreven
Newbie
Newbie
Posts: 1
Joined: Wed Nov 05, 2014 12:00 am

I want to "Set the Bottom Axis to Current Date or Time";but

Post by ifSreven » Fri Nov 28, 2014 10:52 am

I want to "Set the Bottom Axis to Current Date or Time";but Fail; :roll:
Problem1128.jpg
Problem1128.jpg (272.74 KiB) Viewed 3934 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: I want to "Set the Bottom Axis to Current Date or Time";but

Post by Christopher » Fri Nov 28, 2014 2:31 pm

Hello!

You could try something like this:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;

      Line line1 = new Line(tChart1.Chart);

      DateTime dt = DateTime.Today;

      for (int i = 0; i < 10; i++)
      {
        line1.Add(dt, 100);
        dt = dt.AddHours(12);
      }

      tChart1.Axes.Bottom.Labels.Angle = 90;
      tChart1.Axes.Bottom.Labels.DateTimeFormat = "MM/dd hh:mm tt";

    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply