X axis Date series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

X axis Date series

Post by Chuck » Thu Mar 15, 2007 1:33 pm

I is it possible to have a date series for an X axis in an XY chart.
Chart.addXY() is alwats looking for double parameters and wont take a date format.

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Fri Mar 16, 2007 9:32 am

Hi Chuck

Yes, it's possible, in the method "Add" has more of one possibility, you can put two parameters, the first is in X axis and can be a datetime. The second is in Y axis and can be a value. You can do something similar as below code:

Code: Select all

bar1.Add(DateTime.Parse("15/3/07"), 5);
bar1.Add(DateTime.Parse("16/3/07"), 4);
bar1.Add(DateTime.Parse("17/3/07"), 5);
bar1.Add(Convert.ToDateTime("18/3/07"), 2);
bar1.Add(Convert.ToDateTime("19/3/07"), 4);
bar1.Add(Convert.ToDateTime("20/3/07"), 6);
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Fri Mar 16, 2007 10:27 am

Hi Chuck

As a followup, looking at the syntax of your code line, Chart.addXY(), it appears you may be using the ActiveX version of TeeChart. If that is the case my previous reply does not apply well to your question. Datetime is stored as double in the ActiveX version. It could be set as follows:

Code: Select all

With TChart1
  .Series(0).XValues.DateTime = True
  .Series(0).AddXY DateSerial(2007, 4, 1), 5, "", clTeeColor
  .Series(0).AddXY DateSerial(2007, 4, 2), 4, "", clTeeColor
  .Series(0).AddXY DateSerial(2007, 4, 3), 6, "", clTeeColor
End With
Please use the ActiveX forum for future posts if you are using the TeeChart ActiveX version.
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Post Reply