Page 1 of 1

DateTime format by default for axis

Posted: Tue May 06, 2014 1:03 pm
by 15666633
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?

Re: DateTime format by default for axis

Posted: Tue May 06, 2014 4:17 pm
by Christopher
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));
    }