Page 1 of 1

TeeRoundDate -> smaller interval than half-month

Posted: Mon Mar 05, 2007 2:08 pm
by 9349350
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?

Posted: Mon Mar 05, 2007 2:43 pm
by narcis
Hi Hans,

Those TDateTimeSteps are already available in TeeChart v7 VCL. Which TeeChart version are you using?

Using TeeChart 7.07

Posted: Mon Mar 05, 2007 2:48 pm
by 9349350
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.

Posted: Mon Mar 05, 2007 3:29 pm
by narcis
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.

I'll have to check this

Posted: Mon Mar 05, 2007 3:40 pm
by 9349350
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! :!:

Confirmed

Posted: Mon Mar 05, 2007 3:54 pm
by 9349350
This patch is not needed anymore!

happy happy happy
joy joy joy :D