Dates before 1900

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Hans Hasenack
Newbie
Newbie
Posts: 31
Joined: Thu Feb 22, 2007 12:00 am
Location: Nijmegen, Netherlands
Contact:

Dates before 1900

Post by Hans Hasenack » Mon Mar 05, 2007 2:04 pm

I need to show dates before 1-1-1900, (back to 1-1-1850!)

Is there a specific reason why Function TChartAxis.LabelValue

says

if Value>=0 then...

It makes it impossible to display dates before 1-1-1900

(I had to patch it in teechart sourcecode)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 05, 2007 2:39 pm

Hi Hans,

Yes, this is because TDateTime's implementation in the VCL as you can see in Delphi's help files.

However, you could use something like this unit.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Hans Hasenack
Newbie
Newbie
Posts: 31
Joined: Thu Feb 22, 2007 12:00 am
Location: Nijmegen, Netherlands
Contact:

Easy patch

Post by Hans Hasenack » Mon Mar 05, 2007 2:44 pm

All I did was replace the if aDate>0 then... by
if True then...

And it works like a charm. When using negative date values now,
labels are omitted until 1900 and then displayed... ???
:?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 05, 2007 3:34 pm

Hi Hans,

Ok, thanks for the information.

In that case you can add the labels using Add method's override Add(YValue,Label,Color) or AddXY(XValue,Label,Color). Another option would be customizing the labels in the OnGetAxisLabel event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Hans Hasenack
Newbie
Newbie
Posts: 31
Joined: Thu Feb 22, 2007 12:00 am
Location: Nijmegen, Netherlands
Contact:

I know..

Post by Hans Hasenack » Mon Mar 05, 2007 3:42 pm

But I'd rather be able to display dates before 1900 as default behavior than having to write an event handler for this in every spot where I use TCharts.

(Over 300!) :shock:

Hans Hasenack
Newbie
Newbie
Posts: 31
Joined: Thu Feb 22, 2007 12:00 am
Location: Nijmegen, Netherlands
Contact:

I uploaded word document with example

Post by Hans Hasenack » Mon Mar 05, 2007 4:09 pm

I just applied the
"If True" Patch

Check out Pre_1900_Dates.doc

which I just uploaded.

Post Reply