 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
A.Afonso Guest
|
Posted: Tue Mar 01, 2005 9:45 am Post subject: TeeChart Gantt: Visible connection lines |
|
|
Hi all,
Is there a way to show/not show the connecting lines of a group of tasks?
This could be the scenario:
- Series1.ConnectingPen.Visible set to false.
- When the mouse is over a Gantt point, the connection lines between all the
tasks connected to this point (thru the NextTask property) should appear.
- When the mouse leaves the Gantt point, the connection lines should
disappear.
Thanks in adavance,
A.Afonso
|
|
| Back to top |
|
 |
Narcís Calvet Guest
|
Posted: Tue Mar 01, 2005 3:24 pm Post subject: Re: TeeChart Gantt: Visible connection lines |
|
|
Hi,
You cold implement something like below. Once the gantt chart and it's
connections are created it stores those connections into an array and when
the mouse is on a bar the algorithms loads the connections for the selected
bar.
....
....
private
{ Private declarations }
MouseOverSeries: boolean;
NextBar: Array of double;
procedure FirstBar(var Index: Integer);
....
....
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
Series1.FillSampleValues();
Series1.ConnectingPen.Visible:=false;
Chart1.View3D:=false;
MouseOverSeries:=false;
SetLength(NextBar,Series1.Count);
for i:=0 to Series1.Count -1 do
begin
NextBar[i]:=Series1.NextTask[i];
Series1.NextTask[i]:=-1;
end;
end;
procedure TForm1.Series1MouseEnter(Sender: TObject);
begin
MouseOverSeries:=true;
end;
procedure TForm1.Series1MouseLeave(Sender: TObject);
begin
MouseOverSeries:=false;
end;
procedure TForm1.FirstBar(var Index: Integer);
var
i:integer;
begin
for i:=Series1.Count -1 downto 0 do
if NextBar[i]=Index then Index:=i;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
i: integer;
ConnBars: boolean;
begin
if MouseOverSeries then
begin
ConnBars:=true;
i:=Series1.Clicked(X,Y);
FirstBar(i);
while ConnBars do
begin
Series1.NextTask[i]:=NextBar[i];
if NextBar[i]<>-1 then i:=Trunc(NextBar[i])
else ConnBars:=false;
end;
Series1.ConnectingPen.Visible:=true;
end
else
begin
Series1.ConnectingPen.Visible:=false;
for i:=0 to Series1.Count -1 do
Series1.NextTask[i]:=-1;
end;
end;
--
Best Regards,
Narcís Calvet
http://support.steema.com
"Important note: If you are a TeeChart registered customer, please post your
support questions at Steema's Support monitored Forums for customers:
http://support.steema.com for a prompter reply."
"A.Afonso" <aafonso (AT) ids-sa (DOT) es> wrote
| Quote: | Hi all,
Is there a way to show/not show the connecting lines of a group of tasks?
This could be the scenario:
- Series1.ConnectingPen.Visible set to false.
- When the mouse is over a Gantt point, the connection lines between all
the
tasks connected to this point (thru the NextTask property) should appear.
- When the mouse leaves the Gantt point, the connection lines should
disappear.
Thanks in adavance,
A.Afonso
|
|
|
| Back to top |
|
 |
A.Afonso Guest
|
Posted: Fri Mar 18, 2005 4:01 pm Post subject: Re: TeeChart Gantt: Visible connection lines |
|
|
Thanks!. It's working now.
Augusto.
"Narcís Calvet" <support (AT) steema (DOT) com> escribió en el mensaje
news:42248925 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi,
You cold implement something like below. Once the gantt chart and it's
connections are created it stores those connections into an array and when
the mouse is on a bar the algorithms loads the connections for the
selected
bar.
...
...
private
{ Private declarations }
MouseOverSeries: boolean;
NextBar: Array of double;
procedure FirstBar(var Index: Integer);
...
...
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
Series1.FillSampleValues();
Series1.ConnectingPen.Visible:=false;
Chart1.View3D:=false;
MouseOverSeries:=false;
SetLength(NextBar,Series1.Count);
for i:=0 to Series1.Count -1 do
begin
NextBar[i]:=Series1.NextTask[i];
Series1.NextTask[i]:=-1;
end;
end;
procedure TForm1.Series1MouseEnter(Sender: TObject);
begin
MouseOverSeries:=true;
end;
procedure TForm1.Series1MouseLeave(Sender: TObject);
begin
MouseOverSeries:=false;
end;
procedure TForm1.FirstBar(var Index: Integer);
var
i:integer;
begin
for i:=Series1.Count -1 downto 0 do
if NextBar[i]=Index then Index:=i;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
i: integer;
ConnBars: boolean;
begin
if MouseOverSeries then
begin
ConnBars:=true;
i:=Series1.Clicked(X,Y);
FirstBar(i);
while ConnBars do
begin
Series1.NextTask[i]:=NextBar[i];
if NextBar[i]<>-1 then i:=Trunc(NextBar[i])
else ConnBars:=false;
end;
Series1.ConnectingPen.Visible:=true;
end
else
begin
Series1.ConnectingPen.Visible:=false;
for i:=0 to Series1.Count -1 do
Series1.NextTask[i]:=-1;
end;
end;
--
Best Regards,
Narcís Calvet
http://support.steema.com
"Important note: If you are a TeeChart registered customer, please post
your
support questions at Steema's Support monitored Forums for customers:
http://support.steema.com for a prompter reply."
"A.Afonso" <aafonso (AT) ids-sa (DOT) es> wrote in message
news:422439ac (AT) newsgroups (DOT) borland.com...
Hi all,
Is there a way to show/not show the connecting lines of a group of
tasks?
This could be the scenario:
- Series1.ConnectingPen.Visible set to false.
- When the mouse is over a Gantt point, the connection lines between all
the
tasks connected to this point (thru the NextTask property) should
appear.
- When the mouse leaves the Gantt point, the connection lines should
disappear.
Thanks in adavance,
A.Afonso
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|