Skip to main content

Contour plot chart

info

Charts are available with Avalonia Pro.

Contour plots interpolate values across two spatial dimensions and render the result as isolines, filled regions, or both.

When to use

  • Surface estimation: Visualize a scalar field from scattered measurements.
  • Hotspot analysis: Reveal peaks, valleys, and gradients in two dimensions.
  • Engineering maps: Show pressure, temperature, or concentration surfaces.

Code example

XAML

<charts:ContourPlot Title="Temperature field"
Height="320"
ItemsSource="{Binding ContourData}"
XPath="X"
YPath="Y"
ValuePath="Temperature"
ContourLevels="10" />

Data model (C#)

public record ContourPoint(double X, double Y, double Temperature);

public ObservableCollection<ContourPoint> ContourData { get; } = new()
{
new(0, 0, 18),
new(0, 10, 24),
new(10, 0, 21),
new(10, 10, 28)
};

Common properties

PropertyDescriptionDefault
ItemsSourceCollection of sampled points.null
XPathPath to the X coordinate.null
YPathPath to the Y coordinate.null
ValuePathPath to the scalar value.null
ContourLevelsNumber of contour levels to compute.8
ShowFillWhether to fill the contour regions.true
ShowLinesWhether to draw contour lines.true

See also