TeeRoundDate -> smaller interval than half-month

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:

TeeRoundDate -> smaller interval than half-month

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

I need day and week intervals.

So I had to add:

if AStep<dtHalfMonth then
begin
Case AStep of
dtOneDay: result:=round(ADate);
dtTwoDays: result:=round(ADate/2.0)*2;
dtThreeDays: result:=round(ADate/3.0)*3;
dtOneWeek: result:=2.0+round((ADate-2.0)/7.0)*7;
else result:=ADate;
end;
end
else
begin
DecodeDate(ADate,Year,Month,Day);
Case AStep of ... (original code)


Apart from that, TeeRoundDate is (also) unable to round dates before 1-1-1900. Can you fix this please?

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:43 pm

Hi Hans,

Those TDateTimeSteps are already available in TeeChart v7 VCL. Which TeeChart version are you using?
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:

Using TeeChart 7.07

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

Yep I know these steps are available, only teeRoundDate does not like these intervals causing strange behavior in when using date axis...

I also have a patch fixing the problem when too many labels are generated. eg create chart for 100 years with day resolution data, and all labels will be overlapping each other, which lookes quite messy.

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:29 pm

Hi Hans,

If you leave your axes increment to automatic TeeChart will calculate the increment so that labels don't overlap. And if you zoom the chart the increment will be automatically recalculated.
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'll have to check this

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

In TeeChart6 I needed this to avoid overlapping labels.

If it is fixed in TeeChart7: great, another patch can be left out! :D

I'll let you now my findings! :!:

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

Confirmed

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

This patch is not needed anymore!

happy happy happy
joy joy joy :D

Post Reply