![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | [TV52016171] TCHart has trouble handling dates < 1895, only in XE2! The following... | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | yeray alonso <yeray> |
| Component: | Axis | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | CONFIRMED --- | ||
| Severity: | enhancement | ||
| Priority: | Normal | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
TCHart has trouble handling dates < 1895, only in XE2! The following code gives an "invalid floating point operation" error in XE2. {$I TeeDefs.inc} uses {$IFDEF D16} VCLTee.Series; {$ELSE} Series; {$ENDIF} procedure TForm1.FormCreate(Sender: TObject); var y:integer; sr:tChartSeries; begin sr:=Chart1.AddSeries(TBarSeries.Create(Self)); sr.XValues.DateTime:=True; Chart1.Axes.Bottom.ExactDateTime:=True; Chart1.Axes.Bottom.Increment:=DateTimeStep[dtOneYear]; Chart1.Axes.Bottom.RoundFirstLabel:=True; Chart1.Axes.Bottom.DateTimeFormat:='dd/mm/yyyy'; for y:=1850 to 2012 do sr.AddXY(EncodeDate(y,1,1),random(100)); // boum!! { for y:=1896 to 2012 do sr.AddXY(EncodeDate(y,1,1),random(100));} // ok end; The customer suggests a fix, but it doesn't look very definitive to me: http://www.teechart.net/support/viewtopic.php?f=3&t=13215&view=unread#p57597 If I understant it well, it actually "truncates" the date between the interval (1/1/1 - 31/12/9999). But what if anyone wants to have a date before Christ? We could do something like: if (v < EncodeDate(1,1,1)) then v:=Abs(v-EncodeDate(1,1,1)) and set a "BC" flag to add the BC/AC string to the labels... I've tried it but doesn't work for me either <g> :-( [created:2012-04-27T13:48:12.000+01:00 reported by:yeray@steema.com reported in version:2012.05.120327 (TeeChart VCL)]