DateTime format by default for axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Petr
Newbie
Newbie
Posts: 39
Joined: Wed Jul 24, 2013 12:00 am

DateTime format by default for axis

Post by Petr » Tue May 06, 2014 1:03 pm

Hi, I would like to set default DateTime format for Bottom axis without associating with any data to it. For examle, when i do this code

Code: Select all

      tChart1.Series.Add( new Steema.TeeChart.Styles.Line() );
      tChart1.Axes.Bottom.SetMinMax( new DateTime( 1, 1, 1, 1, 1, 1 ), new DateTime( 1, 1, 1, 1, 1, 5 ) );
i can see that min and max values are the OADates( which are just double values ), but i want them shown as normal dates in any DateTime format ( for example "HH:MM:ss" ). If i add some date value, eveything start look fine. Are there any way to show labels in DateTime format by default?

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

Re: DateTime format by default for axis

Post by Christopher » Tue May 06, 2014 4:17 pm

Hello Petr,

You can try:

Code: Select all

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

      tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
      tChart1.Series[0].XValues.DateTime = true;
      tChart1.Axes.Bottom.Labels.DateTimeFormat = "HH:mm:ss";
      tChart1.Axes.Bottom.SetMinMax(new DateTime(1, 1, 1, 1, 1, 1), new DateTime(1, 1, 1, 1, 1, 5));
    }
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