Packed bubble chart
info
Charts are available with Avalonia Pro.
Packed bubble charts show category magnitude through bubble size while packing circles tightly into a single frame.
When to use
- Part-to-whole views: Compare categories by size without a bar chart.
- Compact dashboards: Fit many categories into a square card.
- Label-first comparisons: Keep category names inside the bubbles when space allows.
Code example
XAML
<charts:PackedBubbleChart Title="Segment size"
Height="320"
ItemsSource="{Binding Segments}"
LabelPath="Name"
ValuePath="Value"
ShowLabels="True" />
Data model (C#)
public record SegmentBubble(string Name, double Value);
public ObservableCollection<SegmentBubble> Segments { get; } = new()
{
new("Desktop", 42),
new("Mobile", 30),
new("Web", 18)
};
Common properties
| Property | Description | Default |
|---|---|---|
ItemsSource | Collection of bubble items. | null |
ValuePath | Path to the value used for bubble size. | null |
LabelPath | Path to the bubble label. | null |
MinBubbleSize | Minimum bubble size in pixels. | 20.0 |
MaxBubbleSize | Maximum bubble size in pixels. | 80.0 |
ShowLabels | Whether to draw labels inside bubbles when space allows. | true |
LabelFontSize | Base font size for bubble labels. The rendered size is constrained by each bubble radius. | 12.0 |
LabelForeground | Brush used for bubble labels. When null, labels use white. | null |
IsHighlightEnabled | Enables hover highlighting for bubbles. | false |