How to label the date axis with week numbers.


This example labels the date and time axis with week numbers. For this example, set DateLabelBase to a Sunday, and DateLabelInterval to 7 days. The ISOWeekNumber function can be found in JCLDateTime from the JEDI code library.

Screen shot
procedure TForm1.RACGetDateTimeLabelText(
                                      Sender: TObject;
                                      DateTime: TDateTime;
                                      var DateText, TimeText: string);
var
  WeekNumber: integer;
begin
  TimeText := '';
  if DayOfWeek(DateTime) = 1 then begin // label Sundays
    WeekNumber := ISOWeekNumber(DateTime);
    DateText := IntToStr(WeekNumber);
  end else
    DateText := '';
end;
What People Say

... The conclusion cannot be an other one than to state that if you are looking for a planning component you have to get the RAC. For your future planning business it is simply a must.
H. de Boer, Staaf Automatisering (see the full case study)
More …

No malware No spam
McAfee Site Report
Web of Trust