Skip to main content

Population pyramid chart

info

Charts are available with Avalonia Pro.

Population pyramid charts visualize two opposing distributions, most often male and female populations across age groups.

When to use

  • Demographic analysis: Compare age distribution by sex or region.
  • Segment comparison: Show paired distributions across ordered bands.
  • Planning views: Surface concentration in younger or older cohorts quickly.

Code example

XAML

<charts:PopulationPyramidChart Title="Age distribution"
Height="350"
ItemsSource="{Binding PopulationData}"
AgeLabelPath="AgeGroup"
MaleValuePath="Male"
FemaleValuePath="Female" />

Data model (C#)

public record PopulationBand(string AgeGroup, double Male, double Female);

public ObservableCollection<PopulationBand> PopulationData { get; } = new()
{
new("0-9", 12, 11),
new("10-19", 14, 13),
new("20-29", 16, 17)
};

Common properties

PropertyDescriptionDefault
ItemsSourceCollection of population bands.null
AgeLabelPathPath to the band label.null
MaleValuePathPath to the left-side population value.null
FemaleValuePathPath to the right-side population value.null
MaleBrushBrush used for the left-side bars.null
FemaleBrushBrush used for the right-side bars.null
BarGapGap between adjacent bars.2.0
ShowLabelsWhether to show the band labels along the center line.true
LabelFontSizeFont size used for the band labels.10.0
IsHighlightEnabledEnables hover highlighting for population bands.false

See also