Hi,
We use quite a few times Teechart to produce diagrams. Since today, we need to use a gantt chart. (Using version 6.01 with source).
I've encountered a bug (or a missing feature if you like):
To connect two 'Gantt points' one can use:
Series.AddGant( 0, 12, 0, 'something');
Series.AddGant( 14, 15, 1, 'after something');
Series.NextTask[0] := 1; // links the first point to the second point
However, adding another gant
Series.AddGant( 13, 20, 1)
will cause the 'GanttPoints' to be rearranged. The first entry is still at position 0, the second entry is now at position 2, and the third entry is at position 1.
Unfortunately, the NextTask references are NOT updated. !
This should be fixed in the next version (if not already).
A workaround would be to first order all points and then add them. However, everyone using them should also figure out what the behaviour would be for each possible addition. (Troublesome if you dont have the source) meaning what happens when I do this:
Series.AddGant( 0, 12, 0, 'something');
Series.AddGant( 14, 15, 0);
Series.AddGant( 14, 12, 1);
etc etc.
Grtz,
Marck
Bug (or missing feature....) in Gantt chart series
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Marck,
I've been able to reproduce what you report, but noticed that only happens if you the newly added Gantt bar occupies the position (smaller start coordinate and greater end coordinate) of an existing bar as in the case you mentioned. Try the code below to see this behaviour.
I have also added this problem to our defect list to be fixed for future releases.
I've been able to reproduce what you report, but noticed that only happens if you the newly added Gantt bar occupies the position (smaller start coordinate and greater end coordinate) of an existing bar as in the case you mentioned. Try the code below to see this behaviour.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.AddGantt( 0, 12, 0, 'something');
Series1.AddGantt( 14, 17, 1, 'after something');
Series1.NextTask[0] := 1; // links the first point to the second point
Series1.Marks.Visible:=true;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Series1.AddGantt( 13, 20, 1);
end;
procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
MarkText:=IntToStr(ValueIndex);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
fixed?
If I make an 'addGantt' I use the return values as index for the 'NextTask' property. But the lines seem to be connected randomly. So I wanted to ask if it is wrong to use the return value of the 'addGantt' function or if this bug still isnt fixed in the latest version?
thank you
thank you
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AHIS,
It works fine here using latest version available, which is v7.06, and this code:
It works fine here using latest version available, which is v7.06, and this code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i1,i2: Integer;
begin
i1:=Series1.AddGantt(EncodeDateTime(2006,3,2,17,0,0,0),EncodeDateTime(2006,3,12,17,0,0,0),1);
i2:=Series1.AddGantt(EncodeDateTime(2006,3,22,17,0,0,0),EncodeDateTime(2006,4,12,17,0,0,0),2);
Series1.NextTask[i1]:=i2;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis.narcis wrote:Hi AHIS,
It works fine here using latest version available, which is v7.06, and this code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject); var i1,i2: Integer; begin i1:=Series1.AddGantt(EncodeDateTime(2006,3,2,17,0,0,0),EncodeDateTime(2006,3,12,17,0,0,0),1); i2:=Series1.AddGantt(EncodeDateTime(2006,3,22,17,0,0,0),EncodeDateTime(2006,4,12,17,0,0,0),2); Series1.NextTask[i1]:=i2; end;
With the short code you supplied it should be ok, but what happenes if you try it like above? Because you mentioned that the error only occures if
?narcis wrote: the newly added Gantt bar occupies the position (smaller start coordinate and greater end coordinate) of an existing bar
greetings
announce: newsgroup post
I'm gonna post into steema.public.attachments 4 images to make my problem clear. (Topic 'Bug (or missing feature....) in Gantt chart series').
thanks
thanks
SOLUTION
By chance 2 months after my last post I found the solution to my problem myself:
TChart automatically sorts points in ascending order. So if I enter a new Point between existing Points all indices are changed due to this fact. What I didnt knew was that this is a feature and not a bug and you can actually disable it!
TChart1.Series().XValues.Order = 0
TChart1.Series().YValues.Order = 0
A shame that nobody at Steema could come up with this solution!!!
greetings.
TChart automatically sorts points in ascending order. So if I enter a new Point between existing Points all indices are changed due to this fact. What I didnt knew was that this is a feature and not a bug and you can actually disable it!
TChart1.Series().XValues.Order = 0
TChart1.Series().YValues.Order = 0
A shame that nobody at Steema could come up with this solution!!!
greetings.