Gantt chart - events and periods

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

Gantt chart - events and periods

Post by Tri-Direct » Wed Sep 29, 2004 2:15 pm

I'm creating a Gantt chart, with a single series. I'm adding bars using AddGantt, for periods of time e.g 1/9/2004 to 24/10/2004

However another requirement of the gantt is to display events i.e items that just happen on a single day.

I want to be able to change the style of the way single events are displayed, either changing the "mark" text orientation/colour.

So for example, the first bar would be a period, the next bar (on the same line), could be a single day, following by another period.

Is their anyway to do this, or can I only change the actual colour of each gantt bar.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Thu Sep 30, 2004 8:06 am

Hi.

Yes, you can customize gannt bars after they're added to series. For example, if you want to change specific gannt bar color and label text, use the following code:

Code: Select all

// change 4th point parameters
gantt1.XLabels[3] := "Custom";
gantt1.ValueColor[3] := clWhite;
In case you want to customize specific series mark text, you can also use series OnGetMarkText event end change mark text to whatever you like.
Marjan Slatinek,
http://www.steema.com

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

Post by Tri-Direct » Fri Oct 01, 2004 10:09 am

thanks for the reply

I am using the following code to add a gantt

Code: Select all

s1 := Series1.AddGantt(d_datefrom,d_to,sm_lineno,s_description)
I was using

Code: Select all

if s_value = 'E'
Series1.Marks.Item[s1].Color := clred;
and I'm looping this code as I work from top to bottom in a 3 record table.
However because the datasource is not in the same order as the gantt chart displays (a record after this one inserts a gantt before it), I find that it doesn't set the correct gantt bar to red.

to explain more. when record 2 is processed,it adds a gantt bar with a value index of 1, however record 3 bar actually precedes this record, and after this record is processed, that bar from record 2, actually becomes value index of 2 .

How can I stop this happening ?
[/code]

Post Reply