Skip to main content

Hexbin chart

info

Charts are available with Avalonia Pro.

Hexbin charts group nearby points into hexagons so dense scatter data remains readable even when thousands of points overlap.

When to use

  • Dense scatter data: Replace unreadable point clouds with density bins.
  • Spatial concentration: Show where observations cluster in two dimensions.
  • Exploratory analysis: Reveal hotspots and gradients without smoothing the raw data.

Code example

XAML

<charts:HexbinChart Title="Request concentration"
Height="320"
ItemsSource="{Binding HexbinData}"
XPath="X"
YPath="Y"
HexRadius="16" />

Data model (C#)

public record SamplePoint(double X, double Y);

public ObservableCollection<SamplePoint> HexbinData { get; } = new()
{
new(12, 20),
new(14, 22),
new(13, 21),
new(28, 35)
};

Common properties

PropertyDescriptionDefault
ItemsSourceCollection of X and Y points.null
XPathPath to the X value.null
YPathPath to the Y value.null
HexRadiusRadius of each hexagon in pixels.20.0
ColorScaleColor scale used to encode density.Blues
ShowAxesWhether to draw the chart axes.true

See also