vcl-dxganttcontrolviewchart-ede214ef.md
The color-related procedural type for task dependencies in the Chart View.
TdxGanttControlChartViewGetLinkColorEvent = procedure(Sender: TdxGanttControlChartView; ALink: TdxGanttControlTaskPredecessorLink; var AColor: TColor) of object;
| Name | Type | Description |
|---|---|---|
| Sender | TdxGanttControlChartView |
The Chart View that raised the event.
| | ALink | TdxGanttControlTaskPredecessorLink |
The dependency whose color is about to be changed.
| | AColor | TColor |
A system palette color.
|
A dependency is filled with the same color as its predecessor task. The following code example makes the dependency between the first and second tasks yellow (clYellow):
procedure TMyForm.FormCreate(Sender: TObject);
begin
// Loads a chart from the specified XML file
dxGanttControl1.LoadFromFile('C:\Users\Public\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressGanttControl\Data\SoftwareDevelopment.xml');
end;
procedure TMyForm.dxGanttControl1ViewChartGetLinkColor(
begin
// Checks if the dependency links the first and second tasks
if (ALink.PredecessorUID = 2) and (ALink.Task.UID = 3) then
// Fills the dependency with the yellow color
AColor := clYellow;
end;
void __fastcall TMyForm::FormCreate(TObject *Sender)
{ // Loads a chart from the specified XML file
dxGanttControl1->LoadFromFile("C:/Users/Public/Documents/DevExpress VCL Demos/MegaDemos/Product Demos/ExpressGanttControl/Data/SoftwareDevelopment.xml");
}
//---------------------------------------------------------------------------
void __fastcall TMyForm::dxGanttControl1ViewChartGetLinkColor(TdxGanttControlChartView *Sender,
TdxGanttControlTaskPredecessorLink *ALink, TColor &AColor)
{
// Checks if the dependency links the first and second tasks
if (ALink->PredecessorUID == 2 && ALink->Task->UID == 3)
{
// Fills the dependency with the yellow color
AColor = clYellow;
}
}
See Also