Page 1 of 1

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

Posted: Fri Nov 28, 2014 10:52 am
by 15670620
I want to "Set the Bottom Axis to Current Date or Time";but Fail; :roll:
Problem1128.jpg
Problem1128.jpg (272.74 KiB) Viewed 3957 times

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

Posted: Fri Nov 28, 2014 2:31 pm
by Christopher
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";

    }