Page 1 of 1

Gantt and Marks

Posted: Sat Oct 25, 2008 4:15 am
by 9242184
Is there a way to truncate any text in a mark that exceeds the length of a gantt segment.

I require to be able to put a fairly uniform amount of text within the mark, however, ofthen the gantt segment to which it relates will not be as wide as the text.

The width of each segment can vary within any series.


Therefore I wish to "crop off" the ends of the text that extend beyond the gantt segment

Any help would be appreciated.

using D2006 teechart 7 pro

Roy

Posted: Thu Oct 30, 2008 9:01 am
by narcis
Hi Roy,

This could be done using OnGetSeriesMark event. There you know the mark index and its text so that you can use Canvas.TextWidth. Then you'd need each gantt bar width. There's not a direct way to get it but I'll send you an example which aligns the marks to the center, left or right of each gantt bar. You could use similar code for getting gantt bars width.

Hope this helps!

Posted: Sat Nov 01, 2008 12:29 am
by 9242184
Hi Narcis,

Thanks for the reply and supplied sample. I think I can work from there.

However, your sample does not have a problem that I now have and which the Gantt demo in the Pro 7 Features Demo also has.

In your example the marks are contained within the chart area just like the Gantt.Pointers.

I am not able to achieve this, the pointers are contained but the marks extend left/right above/below the actual chart area.

Thanks again

Roy

Posted: Sat Nov 01, 2008 12:36 am
by 9242184
OK Found

series.marks.clip

Cheers,

Roy