Page 1 of 1

Text position on a Gantt Series

Posted: Tue Oct 05, 2004 2:11 pm
by 9233711
In there anyway to position the "mark" text (label) of a Gantt bar, above the actual bar, rather than displaying overlayed over the actual bar ?

Posted: Wed Oct 06, 2004 9:54 am
by 9233711
Anybody ?

Its quite important now, as some of the bars I'm plotting are only 1 to 2 days in size, and with a piece of text over it, you lose the bar (even if the text is translucent)

Posted: Wed Oct 06, 2004 1:34 pm
by Pep
Hi,

yes, you can set a custom position for each series mark. In the code bellow I've "left-aligned" all series marks:

Code: Select all

var i: Integer;
begin
     for i := 0 to Series1.Marks.Positions.Count - 1 do
     with Series1.Marks.Positions.Position[i] do
     begin
          Custom := true;
          LeftTop.x := Series1.CalcXPos(i);
     end;

     Series1.Repaint;
end;
Please note that series marks are created when chart is drawn for the first time. If you'll try to access TSeriesMark.Positions before chart (and marks) is drawn for the first time, you'll trigger AV error.