Page 1 of 1

Mark position of a gantt chart

Posted: Thu Aug 18, 2005 1:11 pm
by 9342814
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.

Posted: Thu Aug 18, 2005 2:10 pm
by narcis
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;