Polar Coordinates

This sample uses C# 12 features, 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.

sample image

View model

using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;

namespace ViewModelsSamples.Polar.Coordinates;

public class ViewModel
{
    public ISeries[] Series { get; set; } = [
        new PolarLineSeries<ObservablePolarPoint>
        {
            Values = [
                new(0, 10),
                new(45, 15),
                new(90, 20),
                new(135, 25),
                new(180, 30),
                new(225, 35),
                new(270, 40),
                new(315, 45),
                new(360, 50),
            ],
            IsClosed = false,
            Fill = null
        }
    ];

    public PolarAxis[] AngleAxes { get; set; } = [
        new PolarAxis
        {
            // force the axis to always show 360 degrees.
            MinLimit = 0,
            MaxLimit = 360,
            Labeler = angle => $"{angle}°",
            ForceStepToMin = true,
            MinStep = 30
        }
    ];
}

XAML

<UserControl x:Class="UnoWinUISample.Polar.Coordinates.View"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:lvc="using:LiveChartsCore.SkiaSharpView.WinUI"
            xmlns:vms="using:ViewModelsSamples.Polar.Coordinates"
            mc:Ignorable="d">
    <UserControl.DataContext>
        <vms:ViewModel/>
    </UserControl.DataContext>
    <lvc:PolarChart Series="{Binding Series}" AngleAxes="{Binding AngleAxes}" />
</UserControl>

Articles you might also find useful: