Dates before 1900 are left out
Posted: Thu Jul 23, 2009 9:27 am
I have use for displaying dates before 1900. back to 1850 as a matter of fact.
For some reason, TChart omits dates before 1900, producing a rather strange result . Check the attachment.
Regards - Hans
Here's the patch:
For some reason, TChart omits dates before 1900, producing a rather strange result . Check the attachment.
Regards - Hans
Here's the patch:
Code: Select all
Function TChartAxis.LabelValue(Const Value:Double):String;
var tmp : String;
Begin
if IAxisDateTime then
begin
{$ifdef HH_PATCH_TC_DATETIME}
if true then // I also want dates before 01-01-1900 !!!
{$else}
if Value>=0 then
{$endif}
Begin
if FDateTimeFormat='' then tmp:=DateTimeDefaultFormat(IRange)
else tmp:=FDateTimeFormat;
DateTimeToString(result,tmp,Value);
end
else result:='';
end
else result:=FormatFloat(FAxisValuesFormat,Value);
if Assigned(ParentChart.FOnGetAxisLabel) then
ParentChart.FOnGetAxisLabel(TChartAxis(Self),nil,-1,Result);
if FLabelsMultiLine then
result:=ReplaceChar(result,' ',TeeLineSeparator);
end;