Skip to main content
Table of Contents

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

  1. Drop TTMSFNCGanttChart from the TMS FNC Gantt Chart palette page onto a form and set its Align to alClient (VCL) or TAlignLayout.Client (FMX).
  2. That's it — the chart owns an internal default project (reachable through GanttChart1.Project) and shows sample data at design time. Assign a separate TTMSFNCGanttProject instance 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.

Add tasks to the chart's project at runtimePascalC++
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.