GanttTask Class

A task of a Gantt chart. It starts at GanttTask.Start, or after the tasks of GanttTask.After, or else after the previous task; it ends at GanttTask.End, or at the start of the first task of GanttTask.Until, or after GanttTask.Duration, or else at its start.

public sealed class GanttTask

Constructors

NameDescription
GanttTask(DiagramText)Initializes a new instance of the GanttTask class.

GanttTask(DiagramText)

GanttTask.cs

Initializes a new instance of the GanttTask class.

public GanttTask(DiagramText name)

Parameters

name DiagramText
The name.

Properties

NameDescription
AfterGets the identifiers of the tasks this task starts after, when GanttTask.Start is not set: it starts at the latest of their ends.
DurationGets or sets the duration, when neither GanttTask.End nor GanttTask.Until are set.
EndGets or sets the end date, or null to end at GanttTask.Until or after GanttTask.Duration.
IdGets or sets the identifier that the other tasks use in GanttTask.After and GanttTask.Until, or null for none.
IsActiveGets or sets a value that indicates whether the task is in progress (Mermaid active).
IsCriticalGets or sets a value that indicates whether the task is critical, drawn in red (Mermaid crit).
IsDoneGets or sets a value that indicates whether the task is done, drawn in gray (Mermaid done).
IsMilestoneGets or sets a value that indicates whether the task is a milestone, drawn as a diamond in the middle of its time (Mermaid milestone).
IsVerticalGets or sets a value that indicates whether the task is a vertical marker across the chart at its start, with its name below (Mermaid vert).
LinkGets or sets the address the task links to in the SVG, or null for none.
NameGets or sets the name, shown in the bar or next to it.
StartGets or sets the start date, or null to start after other tasks.
UntilGets the identifiers of the tasks this task lasts until, when GanttTask.End is not set: it ends at the earliest of their starts.

Gets the identifiers of the tasks this task starts after, when GanttTask.Start is not set: it starts at the latest of their ends.

public IList<string> After { get; }

Property value

IList<string>

Duration

GanttTask.cs

Gets or sets the duration, when neither GanttTask.End nor GanttTask.Until are set.

public GanttDuration? Duration { get; set; }

Property value

GanttDuration?

Gets or sets the end date, or null to end at GanttTask.Until or after GanttTask.Duration.

public DateTime? End { get; set; }

Property value

DateTime?

Gets or sets the identifier that the other tasks use in GanttTask.After and GanttTask.Until, or null for none.

public string? Id { get; set; }

Property value

string?

IsActive

GanttTask.cs

Gets or sets a value that indicates whether the task is in progress (Mermaid active).

public bool IsActive { get; set; }

Property value

bool

IsCritical

GanttTask.cs

Gets or sets a value that indicates whether the task is critical, drawn in red (Mermaid crit).

public bool IsCritical { get; set; }

Property value

bool

Gets or sets a value that indicates whether the task is done, drawn in gray (Mermaid done).

public bool IsDone { get; set; }

Property value

bool

IsMilestone

GanttTask.cs

Gets or sets a value that indicates whether the task is a milestone, drawn as a diamond in the middle of its time (Mermaid milestone).

public bool IsMilestone { get; set; }

Property value

bool

IsVertical

GanttTask.cs

Gets or sets a value that indicates whether the task is a vertical marker across the chart at its start, with its name below (Mermaid vert).

public bool IsVertical { get; set; }

Property value

bool

Gets or sets the name, shown in the bar or next to it.

public DiagramText Name { get; set; }

Property value

DiagramText

Gets or sets the start date, or null to start after other tasks.

public DateTime? Start { get; set; }

Property value

DateTime?

Gets the identifiers of the tasks this task lasts until, when GanttTask.End is not set: it ends at the earliest of their starts.

public IList<string> Until { get; }

Property value

IList<string>

Methods

NameDescription
ToString()Returns the name of the task.

ToString()

GanttTask.cs

Returns the name of the task.

public override string ToString()

Returns

string The name.