Skip to content
daisyBlazor

GanttChart

Tasks as bars from their start to their end date, with progress, milestones, groups and a marker for today: a release plan, a sprint. D3 computes the time scale, rows and ticks; each group takes a theme colour.
Over time
Cover · <GanttChart>
Gantt chartResearch: 10/01/2026 – 10/12/2026 (100 % done); Specs: 10/08/2026 – 10/19/2026 (90 % done); Build: 10/15/2026 – 11/06/2026 (30 % done); Beta: 11/02/2026 – 11/13/2026; Launch (milestone): 11/16/2026OctNovResearchResearch: 10/01/2026 – 10/12/2026 (100 % done) SpecsSpecs: 10/08/2026 – 10/19/2026 (90 % done) BuildBuild: 10/15/2026 – 11/06/2026 (30 % done) BetaBeta: 11/02/2026 – 11/13/2026 LaunchLaunch: 11/16/2026Today: 10/19/2026 Today

Examples

Basic

Each GanttTask has a Name, Start and End; tasks with the same Group are listed under its name, Progress fills the done part and a task without an End is a milestone.

Acme Cloud 3.0 release plan
Acme Cloud 3.0 release planKick-off (milestone): 09/28/2026; Research: 09/28/2026 – 10/09/2026 (100 % done); Specs: 10/05/2026 – 10/16/2026 (100 % done); API: 10/12/2026 – 11/06/2026 (45 % done); Dashboard: 10/19/2026 – 11/13/2026 (10 % done); Docs: 11/02/2026 – 11/20/2026 (0 % done); Beta: 11/16/2026 – 11/27/2026; General availability (milestone): 11/30/2026Oct 04Oct 11Oct 18Oct 25NovNov 08Nov 15Nov 22Nov 29Kick-offKick-off: 09/28/2026DiscoveryResearchResearch: 09/28/2026 – 10/09/2026 (100 % done) SpecsSpecs: 10/05/2026 – 10/16/2026 (100 % done) BuildAPIAPI: 10/12/2026 – 11/06/2026 (45 % done) DashboardDashboard: 10/19/2026 – 11/13/2026 (10 % done) DocsDocs: 11/02/2026 – 11/20/2026 (0 % done) LaunchBetaBeta: 11/16/2026 – 11/27/2026 General availabilityGeneral availability: 11/30/2026Today: 10/19/2026 Today
website/Examples/Charts/GanttChartBasicExample.razor Source

Marker

Today places the marker at any moment (it defaults to the current date) and TodayLabel names it; without groups the tasks are listed in order.

Sprint 42
Sprint 42Search filters: 10/12/2026 – 10/16/2026 (100 % done); Audit log export: 10/14/2026 – 10/21/2026 (80 % done); SSO settings page: 10/16/2026 – 10/22/2026 (60 % done); Rate limit alerts: 10/19/2026 – 10/23/2026 (20 % done); Sprint review (milestone): 10/23/2026 14:00Oct 12Oct 14Oct 16Oct 18Oct 20Oct 22Search filtersSearch filters: 10/12/2026 – 10/16/2026 (100 % done) Audit log exportAudit log export: 10/14/2026 – 10/21/2026 (80 % done) SSO settings pageSSO settings page: 10/16/2026 – 10/22/2026 (60 % done) Rate limit alertsRate limit alerts: 10/19/2026 – 10/23/2026 (20 % done) Sprint reviewSprint review: 10/23/2026 14:00Code freeze: 10/22/2026 12:00 Code freeze
website/Examples/Charts/GanttChartMarkerExample.razor Source

Lanes

Tasks with the same Row share one lane, labelled with the key. ShowGroupHeaders="false" lets groups only colour the bars, ShowLegend names them, GroupColors maps a group to any CSS colour and a task's own Color wins. Dates follow the current culture.

Stand allocation, Oct 5
Stand allocation, Oct 5AF 1234: 10/05/2026 06:00 – 10/05/2026 07:30; LH 402: 10/05/2026 08:15 – 10/05/2026 09:45; AF 1680: 10/05/2026 11:00 – 10/05/2026 12:00; KL 1987: 10/05/2026 06:30 – 10/05/2026 08:00; LH 1030: 10/05/2026 09:00 – 10/05/2026 11:30; KL 1224: 10/05/2026 07:00 – 10/05/2026 10:00; Charter: 10/05/2026 10:30 – 10/05/2026 12:0006:0007:0008:0009:0010:0011:0012:00Stand A1AF 1234: 10/05/2026 06:00 – 10/05/2026 07:30 LH 402: 10/05/2026 08:15 – 10/05/2026 09:45 AF 1680: 10/05/2026 11:00 – 10/05/2026 12:00 Stand A2KL 1987: 10/05/2026 06:30 – 10/05/2026 08:00 LH 1030: 10/05/2026 09:00 – 10/05/2026 11:30 Stand B1KL 1224: 10/05/2026 07:00 – 10/05/2026 10:00 Charter: 10/05/2026 10:30 – 10/05/2026 12:00
Air France Lufthansa KLM
website/Examples/Charts/GanttChartLanesExample.razor Source

Playground

Acme Cloud 3.0 release plan
Acme Cloud 3.0 release planKick-off (milestone): 09/28/2026; Research: 09/28/2026 – 10/09/2026 (100 % done); Specs: 10/05/2026 – 10/16/2026 (100 % done); API: 10/12/2026 – 11/06/2026 (45 % done); Dashboard: 10/19/2026 – 11/13/2026 (10 % done); Docs: 11/02/2026 – 11/20/2026 (0 % done); Beta: 11/16/2026 – 11/27/2026; General availability (milestone): 11/30/2026Oct 04Oct 11Oct 18Oct 25NovNov 08Nov 15Nov 22Nov 29Kick-offKick-off: 09/28/2026DiscoveryResearchResearch: 09/28/2026 – 10/09/2026 (100 % done) SpecsSpecs: 10/05/2026 – 10/16/2026 (100 % done) BuildAPIAPI: 10/12/2026 – 11/06/2026 (45 % done) DashboardDashboard: 10/19/2026 – 11/13/2026 (10 % done) DocsDocs: 11/02/2026 – 11/20/2026 (0 % done) LaunchBetaBeta: 11/16/2026 – 11/27/2026 General availabilityGeneral availability: 11/30/2026Today: 10/28/2026 Today
<GanttChart
            Title="Acme Cloud 3.0 release plan"
            AspectRatio="1.6"
            Tasks="@_tasks" />

@code {
    // Tasks share a Group to be listed together; Progress is the done fraction; no End makes a milestone.
    private readonly GanttTask[] _tasks =
    [
        new("Kick-off", new DateTime(2026, 9, 28)),
        new("Research", new DateTime(2026, 9, 28), new DateTime(2026, 10, 9), "Discovery", 1),
        new("Specs", new DateTime(2026, 10, 5), new DateTime(2026, 10, 16), "Discovery", 1),
        new("API", new DateTime(2026, 10, 12), new DateTime(2026, 11, 6), "Build", 0.45),
        new("Dashboard", new DateTime(2026, 10, 19), new DateTime(2026, 11, 13), "Build", 0.1),
        new("Docs", new DateTime(2026, 11, 2), new DateTime(2026, 11, 20), "Build", 0),
        new("Beta", new DateTime(2026, 11, 16), new DateTime(2026, 11, 27), "Launch"),
        new("General availability", new DateTime(2026, 11, 30), Group: "Launch"),
    ];
}

API

<GanttChart>

DaisyBlazor.Charts

Parameters

  • AspectRatio double
    = 1.78

    Width divided by height. The chart keeps this shape at any width; its text keeps its size.

  • From DateTime?
    = null

    Start of the time axis, e.g. the start of a shift. Defaults to the earliest task; tasks are clipped to it, and tasks that end before it are left out.

  • GroupColors IReadOnlyDictionary<string, string>
    = null

    Optional colour per group name (any CSS colour); other groups cycle through the theme palette. A task's own Color wins.

  • RowHeight double?
    = null

    Height of each row in px, for a chart that lays its categories out as rows (horizontal bars, a Gantt's lanes, a heatmap's rows…): its height then follows its number of rows instead of AspectRatio, so a long list keeps readable rows at any width. A chart, or an orientation, without rows ignores it.

  • ShowGroupHeaders bool
    = true

    List the rows of each group under a header row (the default). False keeps the rows in task order and lets groups only colour the bars, e.g. when a lane holds tasks of several groups.

  • ShowLegend bool
    = false

    Show a legend of the groups and their colours.

  • ShowTitle bool
    = true

    Draw Title as a visible heading above the chart (the default); false keeps it only as the chart's accessible name, for a chart inside a card that already has a heading.

  • ShowToday bool
    = true

    Draw the today marker.

  • Tasks IReadOnlyList<GanttTask>
    = []

    The tasks, listed top to bottom (grouped tasks under their group's header, groups in order of first appearance). A task without an End is a milestone; tasks with the same Row share one lane.

  • Title string
    = null

    Optional heading rendered above the chart; it is also the chart's accessible name.

  • To DateTime?
    = null

    End of the time axis. Defaults to the latest task end; tasks are clipped to it, and tasks that start after it are left out.

  • Today DateTime?
    = null

    The date the today marker shows. Defaults to the current date; the marker is drawn only when it falls within the tasks' span.

  • TodayLabel string
    = "Today"

    Text of the today marker.

  • Width string
    = "100%"

    CSS width of the chart wrapper.

  • Class string
    = null

    Additional CSS classes merged onto the w-full wrapper.

  • Style string
    = null

    Inline styles appended after the width on the wrapper.

Something went wrong while running the docs. Reload