GanttChart¶
- class GanttChart¶
Represents a Gantt chart
- addItem(Milestone|Section|Task|VerticalMarker ...$item)¶
Add item(s) to the GanttChart
- Parameters:
$item (
Milestone|Section|Task|VerticalMarker) – The item(s)
- Returns:
A new
GanttChartinstance with the item(s) added- Return type:
- render(array $attributes = [])¶
Renders the diagram
- Parameters:
$attributes (
array) –HTML attributes for the <pre> tag as name=>value pairs
Note
The mermaid class is added
- Returns:
Mermaid diagram code in a <pre> tag
- Return type:
string
- withComment(string $comment)¶
Set a comment for the chart
- Parameters:
$comment (
string) – The comment
- Returns:
A new
GanttChartinstance with the comment- Return type:
- withItem(Milestone|Section|Task|VerticalMarker ...$item)¶
Set GanttChart item(s)
- Parameters:
$item (
Milestone|Section|Task|VerticalMarker) – The item(s)
- Returns:
A new
GanttChartinstance with the item(s)- Return type:
- withAxisFormat(string $axisFormat)¶
Set the axis date format
See Output date format on the axis
- Parameters:
$item (
Milestone|Section|Task) – The item(s)
- Returns:
A new
GanttChartinstance with the item(s)- Return type:
- withDateFormat(string $dateFormat)¶
Set the chart input date format
- Parameters:
$dateFormat (
string) – The date format
- Returns:
A new
GanttChartinstance with the date format- Return type:
- withExcludes(string|Exclude ...$excludes)¶
Set day(s) that are excluded from task duration calculations
- Parameters:
...$excludes (
string|Exclude) – Day(s) that are excluded from task duration calculations as either a date in the the date format (withDateFormat) or anExcludeenum
- Returns:
A new
GanttChartinstance with the excluded date(s)- Return type:
- withStartOfWeek(Weekday $weekday)¶
Sets the start of the week
Tick markers are placed on the start of the week
- Parameters:
$weekday (
Weekday) – The item(s)
- Returns:
A new
GanttChartinstance with the item(s)- Return type:
- withTickInterval(string $tickInterval)¶
Sets the chart tick interval
- Parameters:
$tickInterval (
string) – The tick interval as a period in the form nt where n is an integer and t is a period, e.g. week
- Returns:
A new
GanttChartinstance with the tick interval- Return type:
- withTitle(string $title)¶
Set a title for the chart
- Parameters:
$title (
string) – The title
- Returns:
A new
GanttChartinstance with the title- Return type:
- withTodayMarker(string $todayMarker)¶
Set the style for the today marker
- Parameters:
$title (
string) – The today marker style. Useoffto hide the today marker
- Returns:
A new
GanttChartinstance with the today marker styled- Return type: