Skip to main content

Dendrogram chart

info

Charts are available with Avalonia Pro.

Dendrograms are tree diagrams frequently used to illustrate the arrangement of the clusters produced by hierarchical clustering. They show how items are merged into a single branch.

Dendrogram tree diagram showing hierarchical clustering with branches merging from leaf nodes toward the root.

When to use

  • Cluster analysis: Visualizing the results of statistical clustering algorithms.
  • Phylogenetic trees: Showing evolutionary relationships between different species.
  • Structural merges: Representing data that stems from many parts but converges into a few groups.

Code example

XAML

<charts:DendrogramChart Name="DendrogramChartSample" Title="Clustering" Height="300"
ItemsSource="{Binding DendrogramData}"
LabelPath="Name"
ChildrenPath="Children" />

Data model (C#)

public class TreeNode
{
public string Name { get; set; } = string.Empty;
public ObservableCollection<TreeNode> Children { get; set; } = new();
}

public ObservableCollection<TreeNode> DendrogramData { get; } = new()
{
new TreeNode { Name = "Root", Children = {
new TreeNode { Name = "A", Children = {
new TreeNode { Name = "A1" },
new TreeNode { Name = "A2" }
}},
new TreeNode { Name = "B", Children = {
new TreeNode { Name = "B1" }
}}
}}
};

Common properties

PropertyDescriptionDefault
ItemsSourceThe hierarchical cluster data.null
LabelPathProperty for the leaf or node names.null
ChildrenPathPath to the nested cluster items.null
DistancePathProperty for the cluster distance or merge height.null
OrientationOrientation of the chart, Horizontal or Vertical.Horizontal
LinkStyleStyle of the lines linking items, Elbow or Straight.Elbow
LeafSpacingSpacing between leaf nodes.25.0