The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information.... |
Home ChartPack RChart Class TRChart Date and Time on Axes | |||
See also: DTXFormat, DTYFormat | |||
Date and Time on Axes |
|||
TRChart provides an efficient way to create axes which are labeled by date and time. The range of the axis should therefore be set to the appropriate TDateTime (see Delphi reference) values. The property ScalePropsX[].LabelType (or ScalePropsY[].LabelType, respectively) has to be set to ftDateTime. In order to set up the range of an axis the properties ScaleNX.RangeLow and ScaleNX.RangeHigh (or, ScaleNY.RangeLow and ScaleNY.RangeHigh) can be set most conveniently by using the functions StringToDateTime, or EncodeDate and EncodeTime. Of course, the user may also assign any TDateTime variable or any function which returns a TDateTime value (such as the function Now ) to the RangeXXX properties. The format of a date/time axis can be adjusted in several respects by changing the property ScalePropsX[].DateFormat (or ScalePropsY[].DateFormat). Note that date/time axes are restricted by the following limitations:
Note: Delphi 1.0 calculates the date from year 1 whereas Delphi 2.0 calculates it from 1899. To convert a Delphi 1.0 date to a Delphi 2.0 date, subtract 693594.0 from the Delphi 1.0 date.
|