Gantt and Marks

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RoyG
Newbie
Newbie
Posts: 5
Joined: Mon Aug 14, 2006 12:00 am

Gantt and Marks

Post by RoyG » Sat Oct 25, 2008 4:15 am

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

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 Oct 30, 2008 9:01 am

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!
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

RoyG
Newbie
Newbie
Posts: 5
Joined: Mon Aug 14, 2006 12:00 am

Post by RoyG » Sat Nov 01, 2008 12:29 am

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

RoyG
Newbie
Newbie
Posts: 5
Joined: Mon Aug 14, 2006 12:00 am

Post by RoyG » Sat Nov 01, 2008 12:36 am

OK Found

series.marks.clip

Cheers,

Roy

Post Reply