Skip to main content

Step line chart

info

Charts are available with Avalonia Pro.

Step line charts use horizontal and vertical lines to connect data points, creating a step-like pattern. They are useful for showing changes that occur at discrete intervals.

Step line chart connecting data points with horizontal and vertical segments as values change at numeric intervals.

When to use

  • Price changes: Visualizing interest rates, price tiers, or inventory levels.
  • Discrete transitions: When the value remains constant between data points.
  • Digital signals: Representing binary or state-based data.

Code example

XAML

<charts:CartesianChart Name="StepLineChart" Title="Step Line Chart" Height="250">
<charts:CartesianChart.HorizontalAxis>
<charts:CategoryAxis />
</charts:CartesianChart.HorizontalAxis>
<charts:CartesianChart.VerticalAxis>
<charts:NumericalAxis />
</charts:CartesianChart.VerticalAxis>
<charts:CartesianChart.Series>
<charts:StepLineSeries Title="Price" ItemsSource="{Binding StepLineSeriesData}" Stroke="Teal" StrokeThickness="2" MarkerSize="6" ShowMarkers="True"/>
</charts:CartesianChart.Series>
</charts:CartesianChart>

Data model (C#)

public ObservableCollection<int> StepLineSeriesData { get; } =
new() { 100, 100, 120, 120, 120, 140, 140, 160 };

Common properties

PropertyDescriptionDefault
TitleThe name of the series.null
ItemsSourceThe collection of data items.null
CategoryPathPath to the property used for the X-axis value.null
ValuePathPath to the property used for the Y-axis value.null
StrokeColor of the step line.Theme-dependent
StrokeThicknessWidth of the line.2
ShowMarkersWhether to display markers at each data point. Marker styling is visible only when this is true.false
MarkerSizeThe size of the markers in pixels.6
MarkerShapeThe shape of the markers, such as Circle or Square.Circle
MarkerFillBrush used to fill the markers.null
MarkerStrokeBrush used for the marker outlines.null
MarkerStrokeThicknessThickness of the marker outlines. When NaN, the series StrokeThickness is used.NaN
StepModeHorizontalFirst, VerticalFirst, or Center.HorizontalFirst