Loading...
Loading...
Implementation guide for Syncfusion WinUI Polar Chart (SfPolarChart) control. Use this when working with polar charts, radar charts, or spider charts for radial data visualization in WinUI applications. This skill covers line and area series for visualizing data in terms of values and angles, multi-dimensional data comparison, and directional data visualization with PolarLineSeries and PolarAreaSeries.
npx skill4agent add syncfusion/winui-ui-components-skills syncfusion-winui-polar-chartsSfPolarChartSyncfusion.UI.Xaml.ChartsSyncfusion.Chart.WinUISyncfusion.Chart.WinUIpublic class PlantData
{
public string Direction { get; set; }
public double Tree { get; set; }
}using System.Collections.ObjectModel;
public class ChartViewModel
{
public ObservableCollection<PlantData> PlantDetails { get; set; }
public ChartViewModel()
{
PlantDetails = new ObservableCollection<PlantData>()
{
new PlantData { Direction = "North", Tree = 80 },
new PlantData { Direction = "NorthEast", Tree = 87 },
new PlantData { Direction = "East", Tree = 78 },
new PlantData { Direction = "SouthEast", Tree = 85 },
new PlantData { Direction = "South", Tree = 81 },
new PlantData { Direction = "SouthWest", Tree = 88 },
new PlantData { Direction = "West", Tree = 80 },
new PlantData { Direction = "NorthWest", Tree = 85 }
};
}
}<Window
x:Class="PolarChartDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:chart="using:Syncfusion.UI.Xaml.Charts"
xmlns:local="using:PolarChartDemo">
<chart:SfPolarChart Header="Plant Distribution">
<!-- Set DataContext to ViewModel -->
<chart:SfPolarChart.DataContext>
<local:ChartViewModel/>
</chart:SfPolarChart.DataContext>
<!-- Primary Axis (Angular) -->
<chart:SfPolarChart.PrimaryAxis>
<chart:CategoryAxis/>
</chart:SfPolarChart.PrimaryAxis>
<!-- Secondary Axis (Radial) -->
<chart:SfPolarChart.SecondaryAxis>
<chart:NumericalAxis/>
</chart:SfPolarChart.SecondaryAxis>
<!-- Legend -->
<chart:SfPolarChart.Legend>
<chart:ChartLegend/>
</chart:SfPolarChart.Legend>
<!-- Series -->
<chart:SfPolarChart.Series>
<chart:PolarAreaSeries ItemsSource="{Binding PlantDetails}"
XBindingPath="Direction"
YBindingPath="Tree"
Label="Tree"
ShowDataLabels="True"/>
</chart:SfPolarChart.Series>
</chart:SfPolarChart>
</Window>using Syncfusion.UI.Xaml.Charts;
public sealed partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
// Create chart
SfPolarChart chart = new SfPolarChart();
chart.Header = "Plant Distribution";
// Set ViewModel
ChartViewModel viewModel = new ChartViewModel();
chart.DataContext = viewModel;
// Configure axes
chart.PrimaryAxis = new CategoryAxis();
chart.SecondaryAxis = new NumericalAxis();
// Add legend
chart.Legend = new ChartLegend();
// Create series
PolarAreaSeries series = new PolarAreaSeries();
series.XBindingPath = "Direction";
series.YBindingPath = "Tree";
series.Label = "Tree";
series.ShowDataLabels = true;
series.SetBinding(
ChartSeriesBase.ItemsSourceProperty,
new Binding() { Path = new PropertyPath("PlantDetails") });
chart.Series.Add(series);
// Add chart to window
this.Content = chart;
}
}<chart:SfPolarChart GridLineType="Polygon">
<chart:SfPolarChart.PrimaryAxis>
<chart:CategoryAxis/>
</chart:SfPolarChart.PrimaryAxis>
<chart:SfPolarChart.SecondaryAxis>
<chart:NumericalAxis/>
</chart:SfPolarChart.SecondaryAxis>
<chart:PolarLineSeries ItemsSource="{Binding Data}"
XBindingPath="Category"
YBindingPath="Value"
IsClosed="True"/>
</chart:SfPolarChart><chart:SfPolarChart Header="Multi-Series Comparison">
<chart:SfPolarChart.Legend>
<chart:ChartLegend/>
</chart:SfPolarChart.Legend>
<chart:SfPolarChart.Series>
<chart:PolarLineSeries ItemsSource="{Binding SeriesA}"
XBindingPath="Category"
YBindingPath="Value"
Label="Product A"/>
<chart:PolarLineSeries ItemsSource="{Binding SeriesB}"
XBindingPath="Category"
YBindingPath="Value"
Label="Product B"/>
<chart:PolarLineSeries ItemsSource="{Binding SeriesC}"
XBindingPath="Category"
YBindingPath="Value"
Label="Product C"/>
</chart:SfPolarChart.Series>
</chart:SfPolarChart><chart:PolarAreaSeries ShowDataLabels="True">
<chart:PolarAreaSeries.DataLabelSettings>
<chart:PolarDataLabelSettings Context="YValue"
Foreground="White"
Background="#1E88E5"
BorderBrush="White"
BorderThickness="1"
FontSize="12"
FontFamily="Calibri"
Format="#.0"/>
</chart:PolarAreaSeries.DataLabelSettings>
</chart:PolarAreaSeries><chart:SfPolarChart>
<chart:SfPolarChart.Resources>
<BrushCollection x:Key="customBrushes">
<SolidColorBrush Color="#4dd0e1"/>
<SolidColorBrush Color="#26c6da"/>
<SolidColorBrush Color="#00bcd4"/>
</BrushCollection>
</chart:SfPolarChart.Resources>
<chart:SfPolarChart PaletteBrushes="{StaticResource customBrushes}">
<!-- Chart content -->
</chart:SfPolarChart>
</chart:SfPolarChart>| Property | Type | Description |
|---|---|---|
| object | Chart title/header |
| ChartAxis | Angular axis (around the circle) |
| ChartAxis | Radial axis (from center outward) |
| ChartSeriesCollection | Collection of series to display |
| ChartLegend | Legend configuration |
| PolarChartGridLineType | Circle or Polygon |
| ChartPolarAngle | Starting angle (0°, 90°, 180°, 270°) |
| IList<Brush> | Custom color palette |
| Property | Type | Description |
|---|---|---|
| IEnumerable | Data source for the series |
| string | Property path for X values (categories) |
| string | Property path for Y values (numeric) |
| string | Series label for legend |
| bool | Show/hide data labels |
| bool | Close the path (connect last to first) |
| Brush | Fill color for the series |
| Brush | Stroke color for line series |
| PolarDataLabelSettings | Data label configuration |
| Property | Type | Description |
|---|---|---|
| object | Axis title |
| double | Minimum axis value |
| double | Maximum axis value |
| double | Interval between labels |
| double | Rotation angle for labels |
| LabelStyle | Label formatting and appearance |