Skip to main content

Swimlane chart

info

Charts are available with Avalonia Pro.

Swimlane charts organize tasks or processes into distinct horizontal or vertical "lanes." They help visualize workflows across different departments or roles.

Swimlane chart organizing tasks into horizontal lanes by department or role showing ownership and time overlap.

When to use

  • Process mapping: Showing how a request moves between Sales, Engineering, and Support.
  • Project scheduling: Visualizing task ownership across team members.
  • Cross-functional flows: Clarifying responsibilities in a complex business process.

Code example

XAML

<charts:SwimlaneChart Name="SwimlaneSample"
Title="Process Flow"
Height="350"
ItemsSource="{Binding SwimlaneTasks}"
LanePath="Lane"
TaskNamePath="Task"
StartPath="Start"
EndPath="End"
BrushPath="Brush"
LaneHeight="90"
TaskHeight="34"
TaskSpacing="8"
TaskCornerRadius="8"
LaneSeparatorBrush="{DynamicResource DemoSwimlaneLaneSeparatorBrush}"
LaneBackgroundBrush="{DynamicResource DemoSwimlaneLaneBackgroundBrush}" />

Data model (C#)

using Avalonia.Media;

public record SwimlaneTask(string Lane, string Task, double Start, double End, IBrush? Brush = null);

public ObservableCollection<SwimlaneTask> SwimlaneTasks { get; } = new()
{
new("Design", "Wireframes", 0, 3, Brushes.DodgerBlue),
new("Design", "Mockups", 2, 5, Brushes.SteelBlue),
new("Development", "Frontend", 4, 10, Brushes.SeaGreen),
new("Development", "Backend", 3, 9, Brushes.MediumSeaGreen),
new("Testing", "Unit Tests", 6, 10, Brushes.Orange),
new("Testing", "Integration", 9, 12, Brushes.DarkOrange),
new("Deployment", "Staging", 11, 13, Brushes.MediumPurple),
new("Deployment", "Production", 13, 14, Brushes.Purple)
};

StartPath and EndPath expect numeric values. Use your own scale, for example days, hours, sprint points, or sequence positions. Overlapping tasks in the same lane are stacked into rows using TaskSpacing.

Common properties

PropertyDescriptionDefault
ItemsSourceThe collection of tasks/items.null
LanePathDetermines which lane the task belongs to.null
TaskNamePathLabel for the individual task block.null
StartPathProperty name for the numeric start value of the task span.null
EndPathProperty name for the numeric end value of the task span.null
BrushPathProperty name used to bind an IBrush or color string for each task.null
LaneHeightHeight of each lane.80.0
TaskHeightHeight of each task bar.30.0
TaskSpacingSpacing between tasks when stacked in the same lane.5.0
LaneSeparatorBrushBrush used for lane separator lines.null
LaneBackgroundBrushBrush used for alternating lane backgrounds.null
ShowTaskLabelsWhether to display labels inside task bars.true
TaskCornerRadiusCorner radius applied to task bars.4.0

See also