Getting started with TMS FNC Gantt Chart
Prerequisites
- TMS FNC Core installed and the runtime package added to the project.
- TMS FNC Gantt Chart installed and the runtime package referenced.
Add the control
- Drop
TTMSFNCGanttChartfrom the TMS FNC Gantt Chart palette page onto a form and set itsAligntoalClient(VCL) orTAlignLayout.Client(FMX). - That's it — the chart owns an internal default project (reachable through
GanttChart1.Project) and shows sample data at design time. Assign a separateTTMSFNCGanttProjectinstance only when you want to share one schedule between several charts.
Add tasks at runtime
Build tasks through the project, not a raw collection: AddTask creates a task
and AddSubTask nests one beneath it. Pass the start date, duration value, and
duration type directly to the call.
procedure TForm1.FormCreate(Sender: TObject);
var
LDesign: TTMSFNCGanttTask;
begin
GanttChart1.BeginUpdate;
try
GanttChart1.Project.Tasks.Clear;
LDesign := GanttChart1.Project.AddTask('Design', 'Visual design of the site',
Trunc(Now), 3, gdtWorkDays);
LDesign.AddSubTask('Mockups', 'Create the style mockups.',
Trunc(Now), 2, gdtWorkDays);
GanttChart1.Project.AddTask('Implementation', 'Build the site',
Trunc(Now) + 3, 5, gdtWorkDays);
finally
GanttChart1.EndUpdate;
end;
end;
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TTMSFNCGanttTask *LDesign;
GanttChart1->BeginUpdate();
try
{
GanttChart1->Project->Tasks->Clear();
LDesign = GanttChart1->Project->AddTask("Design", "Visual design of the site",
Date(), 3, gdtWorkDays);
LDesign->AddSubTask("Mockups", "Create the style mockups.",
Date(), 2, gdtWorkDays);
GanttChart1->Project->AddTask("Implementation", "Build the site",
Date() + 3, 5, gdtWorkDays);
}
__finally
{
GanttChart1->EndUpdate();
}
}
Next steps
- Guides — timeline options, filtering, appearance customisation.
- API reference — full class reference for
TTMSFNCGanttChart.