GanttDiagram Class
A Gantt chart: tasks on a time axis, grouped in sections, which start at a date or after other tasks and last a duration or until another task (Mermaid gantt). The dates have no time zone; nothing depends on the current date, unless GanttDiagram.Today is set.
public sealed class GanttDiagram : Diagram- Inheritance
DiagramGanttDiagram
Constructors
| Name | Description |
|---|---|
| GanttDiagram() |
GanttDiagram()
GanttDiagram.cspublic GanttDiagram()No documentation is available.
Properties
| Name | Description |
|---|---|
| AxisFormat | Gets or sets the format of the dates of the axis, as the strftime of d3: %Y-%m-%d, %H:%M, %b %d..., or null for %Y-%m-%d. |
| BarGap | Gets or sets the space between two rows of tasks, in pixels. The default is 4. |
| BarHeight | Gets or sets the height of the bars of the tasks, in pixels. The default is 20. |
| Compact | Gets or sets a value that indicates whether the tasks of a section that do not overlap share a row (Mermaid displayMode: compact). |
| DateFormat | Gets or sets the format of the dates in Mermaid, as dayjs: YYYY-MM-DD (the default), HH:mm, X (Unix seconds)... See GanttDiagram.FormatDate. |
| Excludes | Gets the days the tasks do not count, in lower case: weekends, the name of a day (friday), or a date in GanttDiagram.DateFormat or YYYY-MM-DD. A task that spans them is longer, unless it ends at a YYYY-MM-DD date. |
| HideTodayMarker | Gets or sets a value that indicates whether the marker of today is hidden (Mermaid todayMarker off). |
| Includes | Gets the dates that the tasks count even when GanttDiagram.Excludes excludes them. |
| InclusiveEndDates | Gets or sets a value that indicates whether the end dates of the tasks are included: a task that ends on a date lasts until the end of that day. |
| LeftPadding | Gets or sets the width of the column of the titles of the sections, on the left of the axis, in pixels. The default is 75. |
| Sections | Gets the sections. |
| Tasks | Gets the tasks that are in no section, drawn first. |
| TickInterval | Gets or sets the interval between the ticks of the axis, or null to choose about ten ticks. |
| Today | Gets or sets the date the marker of today is drawn at, or null for no marker. Mermaid draws it at the current date, which a Mermaid text does not set. |
| TodayMarkerStyle | Gets or sets the style of the line of the marker of today, or null for the theme. |
| TopAxis | Gets or sets a value that indicates whether the axis is drawn above the tasks too. |
| WeekStart | Gets or sets the first day of a week, where the ticks of a weekly GanttDiagram.TickInterval are. The default is DayOfWeek.Sunday. |
| WeekendStart | Gets or sets the first day of the weekend that weekends excludes: DayOfWeek.Saturday (the default) or DayOfWeek.Friday. |
| Width | Gets or sets the width of the chart, in pixels (Mermaid useWidth). The default is 1200. |
AxisFormat
GanttDiagram.csBarGap
GanttDiagram.csBarHeight
GanttDiagram.csCompact
GanttDiagram.csDateFormat
GanttDiagram.csGets or sets the format of the dates in Mermaid, as dayjs: YYYY-MM-DD (the default), HH:mm, X (Unix seconds)... See GanttDiagram.FormatDate.
public string DateFormat { get; set; }Property value
Exceptions
ArgumentException- The format is empty, or contains a comma, a semicolon,
#or a line break.
Excludes
GanttDiagram.csGets the days the tasks do not count, in lower case: weekends, the name of a day (friday), or a date in GanttDiagram.DateFormat or YYYY-MM-DD. A task that spans them is longer, unless it ends at a YYYY-MM-DD date.
Property value
HideTodayMarker
GanttDiagram.csIncludes
GanttDiagram.csGets the dates that the tasks count even when GanttDiagram.Excludes excludes them.
Property value
InclusiveEndDates
GanttDiagram.csLeftPadding
GanttDiagram.csSections
GanttDiagram.csTasks
GanttDiagram.csGets the tasks that are in no section, drawn first.
Property value
TickInterval
GanttDiagram.csGets or sets the interval between the ticks of the axis, or null to choose about ten ticks.
public GanttTickInterval? TickInterval { get; set; }Property value
Today
GanttDiagram.csTodayMarkerStyle
GanttDiagram.csGets or sets the style of the line of the marker of today, or null for the theme.
public DiagramStyle? TodayMarkerStyle { get; set; }Property value
TopAxis
GanttDiagram.csWeekStart
GanttDiagram.csGets or sets the first day of a week, where the ticks of a weekly GanttDiagram.TickInterval are. The default is DayOfWeek.Sunday.
public DayOfWeek WeekStart { get; set; }Property value
WeekendStart
GanttDiagram.csGets or sets the first day of the weekend that weekends excludes: DayOfWeek.Saturday (the default) or DayOfWeek.Friday.
public DayOfWeek WeekendStart { get; set; }Property value
Width
GanttDiagram.csMethods
| Name | Description |
|---|---|
| AddSection(DiagramText) | Adds a section. |
| AddTask(DiagramText) | Adds a task that is in no section. |
| EnumerateTasks() | Enumerates the tasks, in order: those in no section, then those of the sections. |
| Find(string) | Finds a task by identifier. |
| FormatDate(DateTime) | Formats a date with GanttDiagram.DateFormat; when the text does not parse back to the same date (a format without the time, with a day of the week only, a literal after...), the date is formatted as ISO, 2014-01-06T10:30:00.000. |
| TryParseDate(string, DateTime) | Parses a date with GanttDiagram.DateFormat, or as an ISO date (2014-01-06, 2014-01-06T10:30...). |
AddSection(DiagramText)
GanttDiagram.csAdds a section.
public GanttSection AddSection(DiagramText title)AddTask(DiagramText)
GanttDiagram.csAdds a task that is in no section.
public GanttTask AddTask(DiagramText name)EnumerateTasks()
GanttDiagram.csEnumerates the tasks, in order: those in no section, then those of the sections.
public IEnumerable<GanttTask> EnumerateTasks()Returns
IEnumerable<GanttTask> The tasks.
Find(string)
GanttDiagram.csFinds a task by identifier.
Parameters
idstring- The identifier.
Returns
GanttTask? The last task with this identifier, as Mermaid, or null when there is none.
FormatDate(DateTime)
GanttDiagram.csFormats a date with GanttDiagram.DateFormat; when the text does not parse back to the same date (a format without the time, with a day of the week only, a literal after...), the date is formatted as ISO, 2014-01-06T10:30:00.000.