Text position on a Gantt Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Tri-Direct
Newbie
Newbie
Posts: 11
Joined: Tue Aug 24, 2004 4:00 am

Text position on a Gantt Series

Post by Tri-Direct » Tue Oct 05, 2004 2:11 pm

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 ?

Tri-Direct
Newbie
Newbie
Posts: 11
Joined: Tue Aug 24, 2004 4:00 am

Post by Tri-Direct » Wed Oct 06, 2004 9:54 am

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)

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Oct 06, 2004 1:34 pm

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.

Post Reply