Blazor-ApexGantt renders an interactive project timeline from a C# task collection. You render <ApexGantt> in Razor and hand it a List<GanttTask> and a GanttOptions, both strongly typed. Version 1.5.0 bundles core 3.21 as a self-contained ES module, so there is no npm, no bundler and no script tag.

dotnet add package Blazor-ApexGantt
@using Blazor_ApexGantt.Components
@using Blazor_ApexGantt.Models
@rendermode InteractiveServer

<ApexGantt Options="@options" Tasks="@tasks" />

@code {
    private GanttOptions options = new()
    {
        Width = "100%",
        Height = "500px"
    };

    private List<GanttTask> tasks = new()
    {
        new GanttTask
        {
            Id = "design",
            Name = "Design",
            StartTime = new DateTime(2026, 1, 1),
            EndTime = new DateTime(2026, 1, 15),
            Progress = 45
        },
        new GanttTask
        {
            Id = "build",
            Name = "Build",
            StartTime = new DateTime(2026, 1, 16),
            EndTime = new DateTime(2026, 2, 28),
            Dependency = "design"
        },
        // A milestone: no EndTime, drawn as a diamond on its start date.
        new GanttTask
        {
            Id = "launch",
            Name = "Launch",
            StartTime = new DateTime(2026, 3, 5),
            Type = TaskType.Milestone
        }
    };
}

Two constraints to know before you plan around it. It targets .NET 9 only, unlike the chart and data grid packages which cover .NET 8, 9 and 10. And ApexGantt is Premium and above with no free tier: the $2M threshold that makes some Apex products free does not apply, so without a key the chart carries an evaluation watermark whatever your size.

A Timeline Is a Projection of Your Task List

Hand the component a List<GanttTask> and the timeline is what comes out. Dates take a DateTime or a string, Dependency takes a task id or a TaskDependency with a type and lag, and ParentId nests tasks. Nothing asks you to reshape your domain model into a chart configuration first.


Critical Path Without the Arithmetic

Set EnableCriticalPath and the engine walks the dependency graph and highlights the chain that decides the end date. CriticalBarColor and CriticalArrowColor style it. With a working calendar set, lag counts working days, so the path reflects the schedule your team actually works.


Planned Against Actual

Each GanttTask takes a Baseline with its planned dates, drawn below the actual bar once baselines are enabled on the options. Slippage becomes visible rather than something you compute in a report, and the comparison travels in the same task objects as everything else.


Continuous Zoom, Not Fixed View Modes

PixelsPerDay replaced the old view-mode presets in 1.3.0. About 25.7 reads as weeks, 4.9 as months and 1.6 as quarters, and leaving it off auto-fits the data span. ZoomInAsync and ZoomOutAsync step it at runtime, so a day view and a year view are the same option at different values.

One Package, No Toolchain

Since 1.3.0 the engine is vendored as a self-contained ES module and imported by the package itself. No npm, CDN or script tag.

Typed Tasks and Options

GanttTask and over eighty GanttOptions properties as typed C#, so an option name or enum value is checked at build time.

Dependencies with Lag

FS, FF, SF and SS relationships, with lag or lead counted in working days once a calendar is set.

Milestones

Type = TaskType.Milestone renders a diamond on the start date. One enum value, no separate collection.

Critical Path and Baselines

Both are option flags. The engine walks the graph and draws the planned bar under the actual one.

Undo and Redo

Built-in history with CanUndoAsync and CanRedoAsync, plus an OnHistoryChange callback to drive your own toolbar.

Twenty Typed Events

Drag, resize, add, delete, move, progress, dependency, selection, sort, filter, group, column and validation events as EventCallbacks.

.NET 9 Only, Premium Plan

Targets .NET 9, not .NET 8. ApexGantt has no free tier: without a key the chart carries an evaluation watermark whatever your size.

Add a Gantt Chart to a Blazor App

Three steps. Start with the package:

dotnet add package Blazor-ApexGantt

Register the services in Program.cs. This step is required, not optional, and it is where the license key goes:

using Blazor_ApexGantt.Extensions;

builder.Services.AddApexGantt(options =>
{
    options.LicenseKey = "APEX-...";
});

Then add the namespaces to _Imports.razor. Note the underscores: the NuGet package is Blazor-ApexGantt but the C# namespace is Blazor_ApexGantt, because a hyphen is not legal in an identifier.

@using Blazor_ApexGantt.Components
@using Blazor_ApexGantt.Models

Nothing is copied into wwwroot and there is no script tag. Since 1.3.0 the package vendors the timeline engine and imports it itself as a static web asset.

Dependencies That Carry Their Own Semantics

The simple case stays simple: set Dependency to a task id string and you get Finish-to-Start with zero lag. When the relationship is the point, pass a TaskDependency instead.

new GanttTask
{
    Id = "qa",
    Name = "QA",
    StartTime = new DateTime(2026, 2, 20),
    EndTime = new DateTime(2026, 3, 4),
    // A plain string is Finish-to-Start with zero lag.
    // A TaskDependency spells the relationship out.
    Dependency = new TaskDependency
    {
        TaskId = "build",
        Type = DependencyType.SS,
        Lag = 3
    }
}

DependencyType covers FS, FF, SF and SS. Lag is an integer that goes negative for lead. It counts working days when a working calendar is set and calendar days otherwise. LagUnit never had an effect and is marked [Obsolete] from 1.4.0, so remove the assignment. Lag feeds the critical path and the arrow tooltip, and links never move tasks.

A milestone is one enum value. Set Type = TaskType.Milestone and leave EndTime off, and the task renders as a diamond on its start date, which is what the third task in the hero above is doing. The Type is the clearest form rather than a requirement: since 1.4.0 a childless task with no EndTime and no Type is drawn as a milestone too. An explicit TaskType.Task with no EndTime is still rejected.

Scheduling Features Are Option Flags

Critical path, baselines, the working calendar and undo history are all configuration rather than code you write:

private GanttOptions options = new()
{
    Height = "500px",
    EnableCriticalPath = true,
    CriticalBarColor = "#DC2626",
    Baseline = new BaselineOptions { Enabled = true },
    Calendar = new CalendarOptions { WorkingWeekdays = [1, 2, 3, 4, 5] },
    History = new HistoryOptions { Enabled = true }
};

GanttOptions carries over eighty typed properties in this shape, covering appearance, column configuration, sorting, grouping, filtering, the crosshair, annotations, the project boundary, assignees, task segments and summary bars.

ViewMode is gone as of 1.3.0, along with EnableToolbar. Zoom is continuous through PixelsPerDay: about 80 reads as days, 25.7 as weeks, 4.9 as months, 1.6 as quarters and 0.5 as years, and omitting it auto-fits the data span. Code written against 1.2.0 that sets ViewMode will not compile.

Drive the Timeline at Runtime

Hold the component with @ref and the whole runtime API is available as awaitable C#, rather than something you reach through JavaScript interop yourself.

<ApexGantt @ref="gantt" Options="@options" Tasks="@tasks"
           OnTaskDragged="OnDragged"
           OnHistoryChange="OnHistory" />

@code {
    private ApexGantt? gantt;

    private async Task AddPhase()
    {
        await gantt!.AddTaskAsync(new GanttTask
        {
            Id = "rollout",
            Name = "Rollout",
            StartTime = new DateTime(2026, 3, 6),
            EndTime = new DateTime(2026, 3, 20)
        });

        await gantt.AddDependencyAsync("launch", "rollout", DependencyType.FS, lag: 0);
        await gantt.ScrollToTaskAsync("rollout");
    }

    private void OnDragged(TaskDraggedEventArgs e) => MarkDirty(e.TaskId);
    private void OnHistory(HistoryChangeEventArgs e) => (canUndo, canRedo) = (e.CanUndo, e.CanRedo);
}

There are about thirty-five methods: task CRUD (AddTaskAsync, UpdateTaskAsync, DeleteTaskAsync, MoveTaskAsync), reading the plan back (GetTaskAsync, GetTasksAsync, GetDependenciesAsync), ExpandTaskAsync and CollapseTaskAsync, dependencies, UndoAsync and RedoAsync with CanUndoAsync and CanRedoAsync, sorting, grouping, filtering, column widths and order, selection, zoom and ExportChartAsync. UpdateTaskAsync(id, updates, silent: true) applies a value your server sent back without firing your save handler, and ScrollToTaskAsync(id, expand: false) scrolls without opening collapsed parents.

UpdateAsync() sends your task list only when it has changed, so an option change keeps the edits made in the chart and the undo history. UpdateOptionsAsync() never sends the tasks, and UpdateAsync(replaceTasks: true) always reloads them, discarding edits you have not copied back.

Twenty events come back as typed EventCallback parameters, including OnTaskDragged, OnTaskResized, OnDependencyAdded, OnHistoryChange and OnTaskValidationError.

Save Every Edit, and Veto the Ones You Reject

OnTaskUpdate and OnTaskUpdateSuccess fire once per committed edit on every path: drag, resize, progress drag, the edit dialog, inline edits, the keyboard and UpdateTaskAsync. Their Source names the path as a TaskUpdateSource constant, so one handler can save everything and skip your own API calls:

<ApexGantt @ref="gantt" Options="@options" Tasks="@tasks"
           OnTaskUpdateSuccess="OnSaved" />

@code {
    // Fires once per committed edit, whichever way it was made.
    private Task OnSaved(TaskUpdateSuccessEventArgs e) =>
        e.Source == TaskUpdateSource.Api
            ? Task.CompletedTask            // our own UpdateTaskAsync call
            : api.SaveTaskAsync(e.UpdatedTask!);

    // Or take a snapshot of the whole plan, edits included.
    private async Task SaveAll()
    {
        var current = await gantt!.GetTasksAsync();
        var links = await gantt.GetDependenciesAsync();
        await api.SavePlanAsync(current, links);
    }
}

If you also save from OnTaskDragged or OnTaskResized, a drag is now saved twice. Undo and redo do not fire these events.

The events report what already happened. To stop an edit before it lands, pass the core's beforeTaskUpdate hook as a JsFunction in AdditionalOptions. The bundled core runs it for every edit path, and returning false puts the bar back:

@using Blazor_ApexGantt.Serialization

private GanttOptions options = new()
{
    AdditionalOptions = new Dictionary<string, object>
    {
        // Runs before every edit: drag, resize, progress, dialog,
        // inline, keyboard and UpdateTaskAsync. Return false to reject it.
        ["beforeTaskUpdate"] = JsFunction.From("({ task, updates }) => !task.locked")
    }
};

The hook is synchronous JavaScript, so it cannot await a .NET call; a returned Promise does not cancel anything. Put the data it needs on the task, through AdditionalData, before the user starts dragging.

Custom Tooltips

From 1.4.0 the tooltip options that are functions in the core take a JsFunction: JavaScript source written in C# and compiled once in the browser. A tooltip runs synchronously on every hover, which an async .NET callback cannot answer in time.

@using Blazor_ApexGantt.Serialization

private GanttOptions options = new()
{
    EnableTooltip = true,
    TooltipTemplate = JsFunction.From(
        "task => `<b>${task.name}</b><div>${task.progress}% complete</div>`")
};

DependencyOptions.TooltipTemplate styles the arrow tooltip and CalendarOptions.HolidayTooltip the holiday stripes. The source runs in the global scope and cannot see your C# variables, so interpolate the values it needs, and never build it from untrusted input. The template returns HTML, so escape any user-entered text it includes.

Follow an Ignite UI Theme

From 1.5.0 a chart can take its bar, grid, text and surface colours, its font and its light or dark variant from the Ignite UI theme on the page. The add-on ships inside the package and needs no extra licence key. Turn it on where you register the services:

// Program.cs
builder.Services.AddApexGantt(options =>
{
    options.LicenseKey = "APEX-...";
    options.IgniteUI = true;
});

Ignite UI is the lowest layer above the built-in defaults. An option you set in GanttOptions wins, then an --apex-gantt-* CSS variable, then the family --apx-* tokens, then a theme named in ThemeName, then Ignite UI. Note the first two: from 1.5.0 an option you pass beats the chart's own CSS variable for the same setting, where before the variable won.

Per chart, DesignSystem = false turns the Ignite UI colours off, Tokens = false also drops the --apx-* tokens, and ThemeName takes a theme registered from JavaScript with registerTheme, or "light" or "dark".

What This Package Does Not Cover

Razor in tooltips and hooks. Tooltip templates and before* hooks are JavaScript passed as a JsFunction, not Razor render fragments or .NET callbacks, so they cannot contain Blazor components or await your services. They run synchronously in the browser, on every hover or edit.

.NET 8. Worth repeating because it is the constraint most likely to stop a project: this package is .NET 9 only.

The AdditionalOptions bag on GanttOptions passes unmodeled keys straight through to the engine, which covers new core options before they are modelled. A JsFunction value in it arrives as a real function.

Blazor Gantt Chart FAQ

What is Blazor-ApexGantt?

Blazor-ApexGantt is a Blazor wrapper for the ApexGantt timeline engine. You render an ApexGantt component in Razor and hand it a List<GanttTask> plus a GanttOptions object, both strongly typed C#. Version 1.5.0 bundles core 3.21 as a self-contained ES module inside the NuGet package, so there is no script tag, CDN reference or npm step.

Which .NET versions does Blazor-ApexGantt support?

Version 1.5.0 targets .NET 9 only. Unlike the chart and data grid packages, which multi-target .NET 8, 9 and 10, a .NET 8 LTS project cannot use it without moving framework. Check this before planning around it.

Is there a free tier for the Blazor Gantt chart?

No. ApexGantt is included in the Premium plan and above, and there is no free tier. The $2M threshold that makes some Apex products free does not apply here: a Premium license is required whatever your financial resources, by companies, individuals, non-profits and educators alike. Without a valid key the chart renders with a trial watermark, which is for evaluation only.

How do I install the Blazor Gantt chart?

Run dotnet add package Blazor-ApexGantt, register the services with builder.Services.AddApexGantt in Program.cs, and add @using Blazor_ApexGantt.Components and @using Blazor_ApexGantt.Models to your _Imports.razor. The registration is where the license key goes, and unlike the data grid package it is required rather than optional.

How do I create a milestone in the Blazor Gantt chart?

Set Type to TaskType.Milestone and leave EndTime off. The task renders as a milestone diamond on its StartTime, and MilestoneColor on the options controls the diamond colour. The Type is the clearest form but no longer required: the core bundled since 1.4.0 also draws a childless task with a StartTime, no EndTime and no Type as a milestone. An explicit TaskType.Task with no EndTime is still rejected.

How do task dependencies work?

The Dependency property takes either a plain task-id string, which means Finish-to-Start with zero lag, or a TaskDependency object for a typed relationship. TaskDependency carries TaskId, a DependencyType of FS, FF, SF or SS, and a Lag that can be negative for lead. Lag counts working days when a working calendar is set and calendar days otherwise. LagUnit never had an effect and is marked [Obsolete] from 1.4.0, so remove the assignment. Lag feeds the critical path and the arrow tooltip, and links never move tasks.

Where did ViewMode go?

It was removed in 1.3.0 along with EnableToolbar. Zoom is now continuous through PixelsPerDay: about 80 reads as days, 25.7 as weeks, 4.9 as months, 1.6 as quarters and 0.5 as years, and omitting it auto-fits the data span. ZoomInAsync and ZoomOutAsync step it at runtime. Code written against 1.2.0 that sets ViewMode will not compile against 1.3.0.

Can I use custom HTML tooltips from Blazor?

Yes, from 1.4.0. TooltipTemplate on GanttOptions takes a JsFunction: JavaScript source written in C# and compiled once in the browser, because the template runs synchronously on every hover and an async .NET callback cannot return the HTML in time. DependencyOptions.TooltipTemplate and CalendarOptions.HolidayTooltip work the same way. The template is JavaScript, not a Razor fragment, so it cannot contain Blazor components.

How do I save the edits users make in the chart?

Handle OnTaskUpdateSuccess, which fires once per committed edit on every path: drag, resize, progress drag, the edit dialog, inline edits, the keyboard and UpdateTaskAsync. Its Source says which. To save the whole plan instead, GetTasksAsync and GetDependenciesAsync return copies of the tasks and links as they are now, edits included. If you also save from OnTaskDragged, a drag is saved twice.

Can the Blazor Gantt chart follow an Ignite UI theme?

Yes, from 1.5.0. Set IgniteUI = true where you call AddApexGantt and charts take their bar, grid, text and surface colours, font and light or dark variant from the Ignite UI theme on the page. The add-on needs no extra licence key. GanttOptions.DesignSystem = false turns it off for one chart, Tokens = false also drops the family --apx-* tokens, and ThemeName picks a theme registered by name.

Why does my Blazor Gantt chart render blank?

Usually the render mode. From .NET 8, Blazor Web Apps render statically by default, so a component that needs JavaScript interop must opt into InteractiveServer, InteractiveWebAssembly or InteractiveAuto. There is no error and nothing in the console when this is wrong. Also check that Height resolves to a real value.

Ready to schedule in C#?

One dotnet add package, one AddApexGantt, and an interactive render mode. ApexGantt needs a Premium license, and works watermarked while you evaluate it.

See ApexGantt features