Animations
Every chart animates its changes: points move to their new positions, new points grow in, removed points shrink out
and axis labels fade in and out as the range changes. Two properties control it: AnimationsSpeed, how long an
animation takes, and EasingFunction, the curve it follows. The chart sets them for everything it draws, and each
series and axis can override them. This article covers both properties, how to disable or delay animations, how the
animated properties work and the UpdaterThrottler, which sets how often the chart updates.
Every property is listed in the API explorer: CartesianChart, EasingFunctions, Animation and Animatable.
What animates
Adding or removing items from an ObservableCollection is enough to animate the chart. A new column grows from
zero, a removed one shrinks back to zero and is removed when its animation ends, and the axis moves to the new range:

When zooming or panning, the labels that leave the axis range fade out and the new ones fade in:

Moving to a new place
Points that are objects, an ObservableValue or any other IChartEntity, keep their visual when Values is
replaced with the same objects in another order, so each one animates from where it was to its new place. This sample
adds a random amount to every pilot every 100 milliseconds and replaces Values with the same pilots sorted by their
new value, so each bar slides to its new row. Each pilot is an ObservableValue with a name and a paint: the data
labels show the name, and PointMeasured paints the bar with the pilot's color.

<UserControl
x:Class="AvaloniaSample.Bars.Race.View"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
xmlns:vms="using:ViewModelsSamples.Bars.Race"
x:DataType="vms:ViewModel">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:CartesianChart TooltipPosition="Hidden">
<lvc:CartesianChart.Series>
<lvc:XamlRowSeries
Values="{Binding Data}"
DataLabelsFormatter="{Binding LabelsFormatter}"
ShowDataLabels="True"
DataLabelsPosition="End"
DataLabelsTranslate="{lvc:Point '-1,0'}"
MaxBarWidth="50"
Padding="10"
PointMeasuredCommand="{Binding PointMeasuredCommand}"/>
</lvc:CartesianChart.Series>
<lvc:CartesianChart.XAxes>
<lvc:XamlAxis SeparatorsPaint="{lvc:SolidColorPaint Color='#dcdcdc'}"/>
</lvc:CartesianChart.XAxes>
<lvc:CartesianChart.YAxes>
<lvc:XamlAxis IsVisible="False"/>
</lvc:CartesianChart.YAxes>
</lvc:CartesianChart>
</UserControl>
using System;
using System.Linq;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.Themes;
using LiveChartsCore.Kernel;
using CommunityToolkit.Mvvm.Input;
namespace ViewModelsSamples.Bars.Race;
// this class is used to store the data for each pilot // mark
// it inherits from ObservableValue, this class implements // mark
// IChartEntity, so it can be used as a data source, it draws the // mark
// Value property as a bar in the chart. // mark
public class PilotInfo : ObservableValue
{
public PilotInfo(string name, int value, SolidColorPaint paint)
{
Name = name;
Paint = paint;
Value = value;
}
public string Name { get; set; }
public SolidColorPaint Paint { get; set; }
}
public partial class ViewModel : ObservableObject
{
private readonly Random _r = new();
public ViewModel()
{
_ = StartRace();
}
[ObservableProperty]
public partial PilotInfo[] Data { get; set; } =
Fetch();
public bool IsReading { get; set; } =
true;
public Func<ChartPoint, string> LabelsFormatter { get; set; } =
GetPilotName;
[RelayCommand]
public void OnPointMeasured(ChartPoint point)
{
// assign the pilot color to the bar
var pilot = (PilotInfo?)point.Context.DataSource;
if (point.Context.Visual is null || pilot is null) return;
point.Context.Visual.Fill = pilot.Paint;
}
private static string GetPilotName(ChartPoint point)
{
var pilot = (PilotInfo?)point.Context.DataSource;
return pilot is null ? string.Empty : pilot.Name;
}
private async Task StartRace()
{
await Task.Delay(1000);
// to keep this sample simple, we run the next infinite loop
// in a real application you should stop the loop/task when the view is disposed
while (IsReading)
{
// do a random change to the data
foreach (var item in Data)
item.Value += _r.Next(0, 100);
Data = [.. Data.OrderBy(x => x.Value)];
await Task.Delay(100);
}
}
private static PilotInfo[] Fetch()
{
// generate a different color for each pilot
var paints = Enumerable.Range(0, 7)
.Select(i => new SolidColorPaint(ColorPalletes.MaterialDesign500[i].AsSKColor()))
.ToArray();
return [
new("Tsunoda", 500, paints[0]),
new("Sainz", 450, paints[1]),
new("Riccardo", 520, paints[2]),
new("Bottas", 550, paints[3]),
new("Perez", 660, paints[4]),
new("Verstapen", 920, paints[5]),
new("Hamilton", 1000, paints[6])
];
}
}
Animations speed
AnimationsSpeed is a TimeSpan, 800 milliseconds by default. As a reference, 1 second is a slow animation and 100
milliseconds a fast one.
In XAML a TimeSpan is written as hh:mm:ss, the seconds can have decimals:
<!-- 100 milliseconds -->
<lvc:CartesianChart
Series="{Binding Series}"
AnimationsSpeed="00:00:00.100"><!-- mark -->
</lvc:CartesianChart>
<!-- 1 second -->
<lvc:CartesianChart
Series="{Binding Series}"
AnimationsSpeed="00:00:01"><!-- mark -->
</lvc:CartesianChart>
To change the speed or the easing function of every chart in the app, set them in a theme rule
(HasRuleForChart); the rule applies to every chart that does not set them, see the
themes article.
EasingFunction property
An easing function defines how an animation moves from start to end: at a constant pace, slowing down near the end,
bouncing, and so on. EasingFunction is a Func<float, float>, EasingFunctions.ExponentialOut by default. The
LiveChartsCore.EasingFunctions class contains the common curves:
BackIn,BounceIn,CircleIn,CubicIn,ElasticIn,ExponentialIn,PolinominalIn,QuadraticInandSinIn, and theOutandInOutversion of each one, such asBounceOutandBounceInOut.Ease,EaseIn,EaseOutandEaseInOut, the cubic Bézier curves CSS uses with the same names.Lineal, a constant pace.
This chart uses the BounceOut curve:
public class ViewModel
{
public Func<float, float> Easing { get; set; } = EasingFunctions.BounceOut; // mark
public ISeries[] Series { get; set; } = [ /* ... */ ];
}
<lvc:CartesianChart
Series="{Binding Series}"
EasingFunction="{Binding Easing}"><!-- mark -->
</lvc:CartesianChart>

Build your own curve
The function takes the time of the animation, from 0 (start) to 1 (end), and returns the progress, where 0 is
the initial value and 1 the final value. Any function works:
chart.EasingFunction = time =>
{
var progress = time * time; // quadratic curve
// a constant pace would be:
// var progress = time;
// a sin out curve:
// var progress = (float)Math.Sin(time * Math.PI / 2d);
return progress;
};
EasingFunctions also has builders that return a curve with your own parameters, based on the
d3-ease library:
// back curves, with the overshoot (1.70158 in BackOut)
chart.EasingFunction = EasingFunctions.BuildCustomBackOut(2f);
// elastic curves, with the amplitude and the period
chart.EasingFunction = EasingFunctions.BuildCustomElasticOut(1.5f, 0.60f);
// polynomial curves, with the exponent
chart.EasingFunction = EasingFunctions.BuildCustomPolinominalOut(4f);
// a cubic Bézier curve, with its two control points (x1, y1, x2, y2)
chart.EasingFunction = EasingFunctions.BuildCubicBezier(0.68f, -0.55f, 0.27f, 1.55f);
BuildFunctionUsingKeyFrames joins several segments. Each KeyFrame has a Time and a Value, both from 0 to
1, and the EasingFunction used to reach it from the previous frame, Lineal by default. It needs at least two
frames; when the last one is before time 1, the curve keeps its value until the end.
chart.EasingFunction = EasingFunctions.BuildFunctionUsingKeyFrames(new KeyFrame[]
{
new KeyFrame { Time = 0, Value = 0 },
new KeyFrame { Time = 0.5f, Value = 0.8f, EasingFunction = EasingFunctions.CubicOut },
new KeyFrame { Time = 1, Value = 1, EasingFunction = EasingFunctions.BounceOut }
});
Series and axes
Series and axes also have AnimationsSpeed and EasingFunction. Both are null by default, which means the element
uses the value of the chart. Set one of them to override only that value: the other one still comes from the chart.
Series = new ISeries[]
{
new ColumnSeries<int>
{
Values = new[] { 2, 5, 4 },
AnimationsSpeed = TimeSpan.FromMilliseconds(1500), // mark
EasingFunction = EasingFunctions.BounceOut // mark
},
new LineSeries<int>
{
Values = new[] { 3, 1, 6 } // uses the speed and the curve of the chart
}
};
XAxes = new Axis[]
{
new Axis
{
AnimationsSpeed = TimeSpan.FromMilliseconds(300) // mark
}
};
The default tooltip and legend have their own settings: an AnimationsSpeed of 150 milliseconds and the EaseOut
curve in their Easing property.
Disable animations
Setting the EasingFunction of the chart to null disables animations: every change is drawn at its final value.
An AnimationsSpeed of TimeSpan.Zero does the same.
<lvc:CartesianChart
Series="{Binding Series}"
EasingFunction="{x:Null}"><!-- mark -->
</lvc:CartesianChart>
On a series or an axis, null means "use the value of the chart", so to disable the animations of only one series
or axis, set its AnimationsSpeed to TimeSpan.Zero:
new LineSeries<int>
{
Values = new[] { 3, 1, 6 },
AnimationsSpeed = TimeSpan.Zero // mark
}
Charts rendered to images, such as SKCartesianChart, have animations disabled, see
charts as images.
Delay each point
The PointMeasured event (a command in the XAML samples) runs every time a point gets its position and size, and
gives access to the shape drawn for it in point.Context.Visual. SetTransition replaces the animation of that
shape. In this sample each column gets its own Animation: the easing function returns 0 until a delay that grows
with the index of the point, then follows BuildCustomElasticOut(1.5f, 0.60f), so the columns on the right start
moving later.

<UserControl
x:Class="AvaloniaSample.Bars.DelayedAnimation.View"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
xmlns:vms="using:ViewModelsSamples.Bars.DelayedAnimation"
x:DataType="vms:ViewModel">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:XamlColumnSeries
Values="{Binding Values1}"
Padding="2"
PointMeasuredCommand="{Binding PointMeasuredCommand}"/>
<lvc:XamlColumnSeries
Values="{Binding Values2}"
Padding="0"
PointMeasuredCommand="{Binding PointMeasuredCommand}"/>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
</UserControl>
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
namespace ViewModelsSamples.Bars.DelayedAnimation;
public partial class ViewModel
{
public float[] Values1 { get; set; } = FetchVales(0);
public float[] Values2 { get; set; } = FetchVales(-0.15f);
// The PointMesured command/event is triggered when a point size
// and position is calculated, for this example we use a command,
// but you could also subscribe to the series PointMeasured event.
[RelayCommand]
private void OnPointMeasured(ChartPoint point)
{
// each point will have a different delay depending on its index
var index = point.Context.Entity.MetaData!.EntityIndex; // the index of the point in the data source
var delay = index / (float)Values1.Length;
// the animation takes a function, that represents the normalized progress of the animation
// the parameter is the normalized time of the animation, it goes from 0 to 1
// the function must return a value from 0 to 1, where 0 is the initial state
// and 1 is the final state
var duration = TimeSpan.FromSeconds(3);
var animation = new Animation(t => DelayedEase(t, delay), duration);
point.Context.Visual?.SetTransition(animation);
}
private static float DelayedEase(float t, float delay)
{
if (t <= delay) return 0f;
var remappedT = (t - delay) / (1f - delay);
var baseEasing = EasingFunctions.BuildCustomElasticOut(1.5f, 0.60f);
return baseEasing(Clamp(remappedT, 0f, 1f));
}
public static float Clamp(float value, float min, float max)
{
if (value < min) return min;
if (value > max) return max;
return value;
}
private static float[] FetchVales(float offset)
{
var values = new List<float>();
// the EasingFunctions.BounceInOut, is just
// a function that looks nice!
var fx = EasingFunctions.BounceInOut;
var x = 0f;
while (x <= 1)
{
values.Add(fx(x + offset));
x += 0.025f;
}
return [.. values];
}
}
How animated properties work
Everything the chart draws (geometries, labels and paints) derives from Animatable, and its animated properties are
motion properties: setting one does not change the value at once. The property stores where it is now, the new value
and the time, and every time the chart draws a frame, reading the property returns the value at that moment of the
animation: the start value plus the progress returned by the easing function times the distance to the new value.
When a value changes in the middle of an animation, the next animation starts from where the property is, so the
shapes do not jump.
A property returns its final value at once when it has no Animation, when the easing function is null or when the
duration is 0. That is how disabling animations works.
The animated properties of a geometry include X, Y, Opacity, StrokeThickness, the transforms
(TranslateTransform, RotateTransform, ScaleTransform, SkewTransform and TransformOrigin) and DropShadow,
plus Width and Height in shapes with a size. The Color of a SolidColorPaint is also an animated property.
Numbers, points, sizes, colors, paddings, shadows and arrays of numbers move smoothly; a property that holds a paint
switches to the new paint at once.
Each animated property has a static PropertyDefinition named after it, such as DrawnGeometry.XProperty and
BoundedDrawnGeometry.HeightProperty. Use them to change the animation of only some properties:
var animation = new Animation(EasingFunctions.BounceOut, TimeSpan.FromMilliseconds(500));
// only X and Y use this animation
visual.SetTransition(animation, DrawnGeometry.XProperty, DrawnGeometry.YProperty);
// the width and the height change at once
visual.RemoveTransition(BoundedDrawnGeometry.WidthProperty, BoundedDrawnGeometry.HeightProperty);
// with no properties, the call applies to all of them
visual.SetTransition(animation);
// jumps to the end of the running animations
visual.CompleteTransition();
The Animate(animation) extension method calls SetTransition and then CompleteTransition: any running
animation jumps to its end, and the next changes use the new animation.
The library declares these properties with the [MotionProperty] attribute on a partial property, and a source
generator writes the code that animates them. Your own geometries can do the same: reference the
LiveChartsGenerators NuGet package, derive from a geometry class and mark the class and the property as partial.
public partial class MotionGeometry : BoundedDrawnGeometry, IDrawnElement<SkiaSharpDrawingContext>
{
[MotionProperty] // mark
public partial float Diameter { get; set; } // mark
public void Draw(SkiaSharpDrawingContext context) =>
context.Canvas.DrawCircle(X, Y, Diameter, context.ActiveSkiaPaint);
}
The custom drawing article shows how to add a geometry like this one to a chart.
Performance
While an animation runs, the chart draws a new frame on every tick of its render loop. When every property has
reached its final value, it stops drawing until the next change. Disabling animations removes those intermediate
frames, but the chart still measures the series and the axes on every update, with or without animations. When the
data changes very often, reducing how many updates the chart runs with the UpdaterThrottler cuts that work.
UpdaterThrottler property
UpdaterThrottler is a TimeSpan, 50 milliseconds by default. When a change arrives, the chart waits that time
before it updates, and the changes that arrive while it waits do not start new updates: the chart draws all of them
in one update, with the data as it is when the wait ends.
For example, this view model removes the first point and adds a new one:
public class ViewModel
{
private int index = 0;
private Random random = new Random();
private ObservableCollection<ObservablePoint> observableValues;
public ViewModel()
{
observableValues = new ObservableCollection<ObservablePoint>();
Series = new ObservableCollection<ISeries>
{
new ColumnSeries<ObservablePoint> { Values = observableValues }
};
}
public ObservableCollection<ISeries> Series { get; set; }
public void AddRandomItem()
{
var randomValue = random.Next(1, 10);
observableValues.Add(new ObservablePoint(index++, randomValue));
}
public void RemoveFirstItem()
{
observableValues.RemoveAt(0);
}
}
and the app calls it every 50 milliseconds:
// where vm is an instance of the previous ViewModel class.
while (true)
{
vm.RemoveFirstItem();
vm.AddRandomItem();
await Task.Delay(50);
}
With the default throttler and animations of 300 milliseconds, the chart updates about every 50 milliseconds and the columns never stop moving, which makes the chart hard to read:

With an UpdaterThrottler of 500 milliseconds, the data still changes every 50 milliseconds, but the chart updates
about twice per second:
<lvc:CartesianChart
Series="{Binding Series}"
AnimationsSpeed="00:00:00.300"
UpdaterThrottler="00:00:00.500"><!-- mark -->
</lvc:CartesianChart>

Try different values of both properties to find what reads best for your data. To change the default for every
chart, call LiveCharts.Configure(config => config.WithUpdateThrottlingTimeout(TimeSpan.FromMilliseconds(500)))
when the app starts, before any chart is created.