Skip to main content

Circle packing

info

Charts are available with Avalonia Pro.

Circle packing is a variation of a treemap where nodes are represented as circles. Larger circles represent parent categories, with child categories nested as smaller circles inside them.

Circle packing chart with nested circles where parent categories contain proportionally-sized child circles.

When to use

  • Clustering: Visualizing groups and sub-groups in a visually appealing, organic way.
  • Aesthetic overviews: Dashboards where a "bubble" visual is preferred over rigid grids.
  • Relationship proximity: Showing how closely related different items are within a category.

Code example

XAML

<charts:CirclePackingChart Name="CirclePackingChartSample" Title="Package Sizes" Height="350"
ItemsSource="{Binding CirclePackingData}"
ValuePath="Size"
LabelPath="Name" />

Data model (C#)

public record TreeMapItem(string Name, double Size);

public ObservableCollection<TreeMapItem> CirclePackingData { get; } = new()
{
new("Core", 40),
new("Utils", 25),
new("UI", 35)
};

Common properties

PropertyDescriptionDefault
ItemsSourceThe hierarchical items source.null
ValuePathSize/Diameter of the circles.null
LabelPathText displayed near or inside bubbles.null
ChildrenPathPath to the child collection for each node.null
CirclePaddingPadding between packed circles.3.0
PaletteCustom brush collection for the categories.Auto-generated