Page 1 of 1

Gantt chart - events and periods

Posted: Wed Sep 29, 2004 2:15 pm
by 9233711
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.

Posted: Thu Sep 30, 2004 8:06 am
by Marjan
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.

Posted: Fri Oct 01, 2004 10:09 am
by 9233711
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]