Skip to content

gantt

gantt

gantt(
    data: Any,
    task: str = "task",
    start: str = "start",
    end: str | None = "end",
    *,
    duration: str | None = None,
    duration_unit: str | None = None,
    depends: str | None = None,
    parent: str | None = None,
    progress: str | None = None,
    color: str | None = None,
    palette: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    text: str | None = None,
    tooltip: Sequence[str] | None = None,
    title: str = "",
    height: int = 0,
    today: Any = None,
) -> Timeline

A Gantt chart: a lane per task, in the order of the table, with dependencies as arrows, progress as a fill, and milestones (start equal to end) as diamonds. With parent, tasks have sub-tasks: each under its parent, by start, and they fold.

Parameters:

  • data (Any) –

    A table with a row per task.

  • task (str, default: 'task' ) –

    The column of task names; each task gets its own lane.

  • start (str, default: 'start' ) –

    The column of start times.

  • end (str | None, default: 'end' ) –

    The column of end times; or end=None with duration=.

  • duration (str | None, default: None ) –

    A column of durations, or of numbers in duration_unit.

  • duration_unit (str | None, default: None ) –

    What one unit of a numeric duration is ("d", "h", ...).

  • depends (str | None, default: None ) –

    A column with the tasks each task follows: a name, a list of names, or names separated by commas.

  • parent (str | None, default: None ) –

    A column with the task each task is part of (missing for a top task).

  • progress (str | None, default: None ) –

    A column of how far each task is done, 0 to 1.

  • color (str | None, default: None ) –

    A column to color the bars by (a phase, a team), or one colour.

  • palette (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    Colours for the categories of color.

  • text (str | None, default: None ) –

    Written in each bar where it fits (a column or a template).

  • tooltip (Sequence[str] | None, default: None ) –

    Columns shown when hovering a task.

  • title (str, default: '' ) –

    Shown above the chart.

  • height (int, default: 0 ) –

    Height in pixels; 0 sizes the chart to its tasks.

  • today (Any, default: None ) –

    A time to mark with a line labelled "today" (e.g. datetime.now()).

Returns:

  • Timeline –

    The chart: show it as the last expression of a cell.