Mark position of a gantt chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
cbr
Newbie
Newbie
Posts: 7
Joined: Thu Jul 21, 2005 4:00 am
Location: Germany

Mark position of a gantt chart

Post by cbr » Thu Aug 18, 2005 1:11 pm

Hi.

Is there anyway to position the text mark on the right side of the actual gantt bar?

The problem for me is to get the "width" of the actual gantt bar to set the mark position.

Thanks in advance.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Aug 18, 2005 2:10 pm

Hi cbr,

You could do something like:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
  APosition:TSeriesMarkPosition;
begin
  Series1.FillSampleValues();
  Chart1.Draw();

  APosition:=TSeriesMarkPosition.Create;
  try
    for i:=0 to Series1.Count-1 do
    begin
      APosition.Custom:=True;
      APosition.LeftTop.X:=Series1.CalcXPosValue(Series1.EndValues[i])+40;
      APosition.LeftTop.Y:=Series1.Marks.Positions[i].LeftTop.Y;
      Series1.Marks.Positions[i]:=APosition;
    end;
  finally
      APosition.Free;
  end;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply