Skip to main content

Pyramid chart

info

Charts are available with Avalonia Pro.

Pyramid charts are a type of stacked area or bar graph that emphasizes both hierarchy and volume. They are the classic choice for population and sales pipeline visualization.

Pyramid chart with stacked triangular segments representing hierarchical population or pipeline data.

When to use

  • Population pyramids: Showing age and gender distribution in a region.
  • Sales pipelines: Visualizing the funnel from leads to closed deals.
  • Biological hierarchies: Showing energy flow or species distribution in an ecosystem.

Code example

XAML

<charts:PyramidChart Title="Population Distribution" Height="300"
ItemsSource="{Binding PyramidData}"
LabelPath="Age" ValuePath="Value"/>

Data model (C#)

public record PyramidItem(string Age, double Value);

public ObservableCollection<PyramidItem> PyramidData { get; } = new()
{
new("0-14", 15),
new("15-24", 12),
new("25-54", 40),
new("55-64", 18),
new("65+", 15)
};

Common properties

PropertyDescriptionDefault
ItemsSourceThe collection of data layers.null
ValuePathMagnitude of each layer.null
LabelPathText description for each layer.null
SegmentGapVertical distance between levels.2.0
ShowLabelsWhether to display labels on segments.true
ShowValuesWhether to display numeric values on the chart.true
IsHighlightEnabledEnables hover highlighting for pyramid segments.false