Radial Area
This sample uses C# 13 preview features such as partial properties, it also uses features from the CommunityToolkit.Mvvm package, you can learn more about it here.
This web site wraps every sample using a UserControl instance, but LiveCharts controls can be used inside any container.
View model
using LiveChartsCore;
namespace ViewModelsSamples.Polar.RadialArea;
public class ViewModel
{
public int[] Values1 { get; set; } =
[7, 5, 7, 5, 6];
public int[] Values2 { get; set; } =
[2, 7, 5, 9, 7];
public string[] Labels { get; set; } =
["first", "second", "third", "forth", "fifth"];
public double TangentAngle { get; set; } =
LiveCharts.TangentAngle;
}
XAML
<UserControl
x:Class="WPFSample.Polar.RadialArea.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.Polar.RadialArea;assembly=ViewModelsSamples"
xmlns:c="clr-namespace:LiveChartsCore;assembly=LiveChartsCore">
<UserControl.DataContext>
<vms:ViewModel/>
</UserControl.DataContext>
<lvc:PolarChart InitialRotation="-45">
<lvc:PolarChart.Series>
<lvc:SeriesCollection>
<lvc:XamlPolarLineSeries
Values="{Binding Values1}"
LineSmoothness="0"
GeometrySize="0"
Fill="#900000ff"/>
<lvc:XamlPolarLineSeries
Values="{Binding Values2}"
LineSmoothness="1"
GeometrySize="0"
Fill="#90ff0000"/>
</lvc:SeriesCollection>
</lvc:PolarChart.Series>
<lvc:PolarChart.AngleAxes>
<lvc:PolarAxesCollection>
<lvc:XamlPolarAxis
LabelsRotation="{Binding TangentAngle}"
Labels="{Binding Labels}"/>
</lvc:PolarAxesCollection>
</lvc:PolarChart.AngleAxes>
</lvc:PolarChart>
</UserControl>