Gauges
A gauge is a PieChart that shows one or more values against a fixed range, set by the MinValue and MaxValue
of the chart. A solid gauge fills an arc up to each value. An angular gauge draws colored sections, ticks and a needle
that points at the value. Gauge series are pie series, so they take every property described in the
Pie charts article; this article covers
only what is specific to gauges.
This article highlights the most used features. Every property is listed in the API explorer:
GaugeGenerator,
GaugeItem,
PieSeries,
NeedleVisual and
AngularTicksVisual.
In XAML, declare them as XamlGaugeSeries, XamlGaugeBackgroundSeries, XamlAngularGaugeSeries, XamlNeedle and
XamlAngularTicks.
Basic gauge
Set the MinValue and MaxValue of the chart to the range of the gauge. Then add a XamlGaugeSeries
and set its GaugeValue.
When MaxValue is not set, the chart uses the sum of the values, as a regular pie chart does, and the gauge is always
full.
The default theme places the value at the center of the chart (DataLabelsPosition is ChartCenter) and rounds the
ends of the arc with a CornerRadius of 8. InitialRotation is the angle where the arc starts, in degrees: 0 is
the right side of the chart and the angles grow clockwise, so -90 starts at the top. MaxRadialColumnWidth limits
the width of the arc in pixels; the arc stays at the outer edge of the chart.

<UserControl
x:Class="WPFSample.Pies.Gauge1.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.Gauge1;assembly=ViewModelsSamples"
MaxWidth="300"
MaxHeight="300">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:PieChart
InitialRotation="-90"
MinValue="0"
MaxValue="100">
<lvc:PieChart.Series>
<lvc:SeriesCollection>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Value}"
DataLabelsSize="50"
MaxRadialColumnWidth="50"/>
<!-- The background series is used to style the gauge background. -->
<lvc:XamlGaugeBackgroundSeries/>
</lvc:SeriesCollection>
</lvc:PieChart.Series>
</lvc:PieChart>
</UserControl>
namespace ViewModelsSamples.Pies.Gauge1;
public class ViewModel
{
public double Value { get; set; } = 30;
}
Angles
MaxAngle is the angle the whole range covers, 360 by default. This sample draws a 270 degree gauge: it starts at
-225, the bottom left, and ends at the bottom right, leaving the gap at the bottom. Set IsClockwise to false to
fill the arc in the other direction.

<UserControl
x:Class="WPFSample.Pies.Gauge2.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.Gauge2;assembly=ViewModelsSamples"
MaxWidth="300"
MaxHeight="300">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:PieChart
InitialRotation="-225"
MaxAngle="270"
MinValue="0"
MaxValue="100">
<lvc:PieChart.Series>
<lvc:SeriesCollection>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Value}"
Fill="#9ACD32"
ShowDataLabels="True"
DataLabelsSize="50"
DataLabelsPosition="ChartCenter"
InnerRadius="75"/>
<!-- The background series is used to style the gauge background. -->
<lvc:XamlGaugeBackgroundSeries
InnerRadius="75"
Fill="#5A64B5F6"/>
</lvc:SeriesCollection>
</lvc:PieChart.Series>
</lvc:PieChart>
</UserControl>
namespace ViewModelsSamples.Pies.Gauge2;
public class ViewModel
{
public double Value { get; set; } = 30;
}
Background
The background series draws the whole arc, from MinValue to MaxValue, behind the values. It is not shown in the
legend, and the default theme fills it with a light gray (a light transparent white in the dark theme).
Add a XamlGaugeBackgroundSeries to the chart to draw it, and give it the same InnerRadius as the gauge series so
the rings match:
<lvc:XamlGaugeBackgroundSeries
InnerRadius="75"
Fill="{lvc:SolidColorPaint Color='#5A64B5F6'}"/>
Leave it out, or set its Fill to {x:Null}, to draw the gauge without a background.
Multiple values
Add one XamlGaugeSeries per value. Each value gets
its own ring: the first one is the inner ring. InnerRadius leaves a hole in the center, and RelativeInnerRadius
and RelativeOuterRadius leave space between the rings. The background draws behind every ring.
Here the labels go at the Start of each arc, and the DataLabelsFormatter adds the series name to the value.

<UserControl
x:Class="WPFSample.Pies.Gauge3.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.Gauge3;assembly=ViewModelsSamples"
MaxHeight="400"
MaxWidth="400">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:PieChart
InitialRotation="45"
MaxAngle="270"
MinValue="0"
MaxValue="100">
<lvc:PieChart.Series>
<lvc:SeriesCollection>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Vanesa}"
SeriesName="Vanesa"
DataLabelsFormatter="{Binding LabelFormatter}"
DataLabelsPosition="Start"
InnerRadius="20"
RelativeOuterRadius="8"
RelativeInnerRadius="8"/>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Charles}"
SeriesName="Charles"
DataLabelsFormatter="{Binding LabelFormatter}"
DataLabelsPosition="Start"
InnerRadius="20"
RelativeOuterRadius="8"
RelativeInnerRadius="8"/>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Ana}"
SeriesName="Ana"
DataLabelsFormatter="{Binding LabelFormatter}"
DataLabelsPosition="Start"
InnerRadius="20"
RelativeOuterRadius="8"
RelativeInnerRadius="8"/>
<!-- The background series is used to style the gauge background. -->
<lvc:XamlGaugeBackgroundSeries InnerRadius="20"/>
</lvc:SeriesCollection>
</lvc:PieChart.Series>
</lvc:PieChart>
</UserControl>
using System;
using LiveChartsCore.Kernel;
namespace ViewModelsSamples.Pies.Gauge3;
public class ViewModel
{
public double Vanesa { get; set; } = 30;
public double Charles { get; set; } = 50;
public double Ana { get; set; } = 70;
public Func<ChartPoint, string> LabelFormatter { get; set; } =
point => $"{point.Coordinate.PrimaryValue} {point.Context.Series.Name}";
}
Slim gauges
A small MaxRadialColumnWidth draws each value as a thin line. This sample sets it to 5, places the labels at the
End of each arc, and hides the background by setting its Fill to null.

<UserControl
x:Class="WPFSample.Pies.Gauge4.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.Gauge4;assembly=ViewModelsSamples"
MaxHeight="400"
MaxWidth="400">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:PieChart
InitialRotation="-90"
MaxAngle="350"
MinValue="0"
MaxValue="100">
<lvc:PieChart.Series>
<lvc:SeriesCollection>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Vanesa}"
SeriesName="Vanessa"
DataLabelsSize="20"
DataLabelsPosition="End"
DataLabelsFormatter="{Binding Formatter}"
InnerRadius="20"
MaxRadialColumnWidth="5"/>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Charles}"
SeriesName="Charles"
DataLabelsSize="20"
DataLabelsPosition="End"
DataLabelsFormatter="{Binding Formatter}"
InnerRadius="20"
MaxRadialColumnWidth="5"/>
<lvc:XamlGaugeSeries
GaugeValue="{Binding Ana}"
SeriesName="Ana"
DataLabelsSize="20"
DataLabelsPosition="End"
DataLabelsFormatter="{Binding Formatter}"
InnerRadius="20"
MaxRadialColumnWidth="5"/>
<lvc:XamlGaugeBackgroundSeries Fill="{x:Null}"/>
</lvc:SeriesCollection>
</lvc:PieChart.Series>
</lvc:PieChart>
</UserControl>
using System;
using LiveChartsCore.Kernel;
namespace ViewModelsSamples.Pies.Gauge4;
public class ViewModel
{
public double Vanesa { get; set; } = 50;
public double Charles { get; set; } = 80;
public double Ana { get; set; } = 95;
public Func<ChartPoint, string> Formatter { get; set; } =
point => point.Coordinate.PrimaryValue.ToString();
}
Updating the value
Bind GaugeValue to a property that notifies its changes, and the gauge animates to the new value.

<UserControl
x:Class="WPFSample.Pies.Gauge5.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.Gauge5;assembly=ViewModelsSamples"
MaxHeight="400"
MaxWidth="400">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button
Grid.Row="0"
Command="{Binding DoRandomChangeCommand}"
Content="Change Value"/>
<lvc:PieChart
Grid.Row="1"
InitialRotation="-90"
MinValue="0"
MaxValue="100"
MaxAngle="270"
LegendPosition="Bottom">
<lvc:PieChart.Series>
<lvc:SeriesCollection>
<lvc:XamlGaugeSeries
SeriesName="North"
GaugeValue="{Binding Value1}"
DataLabelsPosition="Start"/>
<lvc:XamlGaugeSeries
SeriesName="South"
GaugeValue="{Binding Value2}"
DataLabelsPosition="Start"/>
</lvc:SeriesCollection>
</lvc:PieChart.Series>
</lvc:PieChart>
</Grid>
</UserControl>
using System;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.ComponentModel;
namespace ViewModelsSamples.Pies.Gauge5;
public partial class ViewModel : ObservableObject
{
private readonly Random _random = new();
[ObservableProperty]
public partial double Value1 { get; set; } = 50;
[ObservableProperty]
public partial double Value2 { get; set; } = 80;
[RelayCommand]
public void DoRandomChange()
{
Value1 = _random.Next(0, 100);
Value2 = _random.Next(0, 100);
}
}
See automatic updates for more.
Angular gauge
An angular gauge has three parts:
- Sections: one
XamlAngularGaugeSeriesper section. All the sections share one ring and are placed one after another, in order, starting atMinValue: each value is the length of its section, not its end. In this sample the sections60,30and10cover 0 to 60, 60 to 90 and 90 to 100. Sections have no data labels, do not react to the pointer and do not animate.OuterRadiusOffsetmakes the ring smaller to leave room for the ticks. - Ticks: a
XamlAngularTicksdraws an arc with ticks and labels along the range. The step between ticks is about a tenth of the range, rounded up to 1, 2 or 5 times a power of ten, with four smaller ticks between two labels.OuterOffsetmoves the arc and the ticks in from the edge of the chart,LabelsOuterOffsetdoes the same for the labels,TicksLengthis the length of the ticks,LabelsSizethe size of the labels (12by default) andLabelerformats them. - Needle: a
XamlNeedlepoints at itsValue.Widthis20in the default theme, andFillpaints it. ChangeValueto move it.
The ticks and the needle are visual elements, so they go in the VisualElements of the chart. Both use the
MinValue, MaxValue, InitialRotation and MaxAngle of the chart, so set them, and both only work in a
PieChart.

<UserControl
x:Class="WPFSample.Pies.AngularGauge.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.AngularGauge;assembly=ViewModelsSamples"
MaxHeight="400"
MaxWidth="400">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button
Grid.Row="0"
Command="{Binding DoRandomChangeCommand}"
Content="Change value"/>
<lvc:PieChart
Grid.Row="1"
InitialRotation="-225"
MaxAngle="270"
MinValue="0"
MaxValue="100">
<lvc:PieChart.Series>
<lvc:SeriesCollection>
<lvc:XamlAngularGaugeSeries
GaugeValue="60"
OuterRadiusOffset="130"
MaxRadialColumnWidth="20"
CornerRadius="0"/>
<lvc:XamlAngularGaugeSeries
GaugeValue="30"
OuterRadiusOffset="130"
MaxRadialColumnWidth="20"
CornerRadius="0"/>
<lvc:XamlAngularGaugeSeries
GaugeValue="10"
OuterRadiusOffset="130"
MaxRadialColumnWidth="20"
CornerRadius="0"/>
</lvc:SeriesCollection>
</lvc:PieChart.Series>
<lvc:PieChart.VisualElements>
<lvc:VisualsCollection>
<lvc:XamlNeedle
Width="20"
Value="{Binding Value}"/>
<lvc:XamlAngularTicks
LabelsSize="16"
LabelsOuterOffset="15"
OuterOffset="65"
TicksLength="20" />
</lvc:VisualsCollection>
</lvc:PieChart.VisualElements>
</lvc:PieChart>
</Grid>
</UserControl>
using CommunityToolkit.Mvvm.Input;
using System;
using CommunityToolkit.Mvvm.ComponentModel;
namespace ViewModelsSamples.Pies.AngularGauge;
public partial class ViewModel : ObservableObject
{
private readonly Random _random = new();
[ObservableProperty]
public partial double Value { get; set; } = 45;
public Func<double, string> Labeler { get; set; } =
value => value.ToString("N1");
[RelayCommand]
public void DoRandomChange() =>
Value = _random.Next(0, 100);
}
using LiveChartsCore.SkiaSharpView.Drawing;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace ViewModelsSamples.Pies.AngularGauge;
public class CustomNeedle : NeedleGeometry
{
public override void Draw(SkiaSharpDrawingContext context)
{
var paint = context.ActiveSkiaPaint;
context.Canvas.DrawRect(X - Width * 0.5f, Y, Width, Radius, paint);
}
}
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace ViewModelsSamples.Pies.AngularGauge;
public class SmallNeedle : NeedleGeometry
{
public SmallNeedle()
{
ScaleTransform = new(0.6f, 0.6f);
}
}
Add a XamlGaugeBackgroundSeries to draw a background behind the sections.
The default theme rounds gauge slices with a CornerRadius of 8; this sample sets it to 0 so the sections join
with square ends.
Custom needle
The needle is drawn by a NeedleGeometry. Inherit from it to change the needle, then use your class as the type
argument of the visual: NeedleVisual<SmallNeedle>. XamlNeedle always draws the default needle, so
create the visual in your view model and bind the VisualElements of the chart to a collection that contains it.
This needle sets a ScaleTransform of 0.6, so it is 40% smaller than the default one:
public class SmallNeedle : NeedleGeometry
{
public SmallNeedle()
{
ScaleTransform = new(0.6f, 0.6f);
}
}
var needle = new NeedleVisual<SmallNeedle> { Value = 45 };
Override Draw() to draw the needle yourself with SkiaSharp. X and Y are the center of the chart, Radius the
length of the needle and Width its width; the visual rotates the geometry to the value. This one draws a
rectangle:
public class CustomNeedle : NeedleGeometry
{
public override void Draw(SkiaSharpDrawingContext context)
{
var paint = context.ActiveSkiaPaint;
context.Canvas.DrawRect(X - Width * 0.5f, Y, Width, Radius, paint);
}
}

The default NeedleGeometry source is a good starting point.