You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-14Lines changed: 18 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,12 @@
1
-
# How-to-create-a-Pie-Chart-in-.NET-MAUI
1
+
# How to create a PieChart in .NETMAUI (SfCircularChart)
2
2
3
3
A .NET MAUI Pie charts visual representation of percentages at a certain point in time and it can be used to show percentages of a whole. This section explains how to create a beautiful .NET MAUI Pie Charts.
4
4
5
-

6
-
7
5
## Register the handler.
8
-
Syncfusion.Maui.Core nuget is a dependent package for all Syncfusion controls of .NET MAUI. In the MauiProgram.cs file, register the handler for Syncfusion core. For more details refer this link.
6
+
Syncfusion.Maui.Core nuget is a dependent package for all Syncfusion controls of .NET MAUI. In the MauiProgram.cs file, register the handler for Syncfusion core. For more details refer this [link](https://help.syncfusion.com/maui/cartesian-charts/getting-started#register-the-handler).
9
7
10
8
## Initialize Chart
11
-
Import the SfCircularChart namespace as shown below.
9
+
Import the [SfCircularChart](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.SfCircularChart.html?tabs=tabid-1) namespace as shown below.
12
10
13
11
**[XAML]**
14
12
@@ -73,9 +71,9 @@ public class ViewModel
73
71
}
74
72
}
75
73
```
76
-
Set the ViewModel instance as the BindingContext of chart; this is done to bind properties of ViewModel to SfCircularChart.
74
+
Set the **ViewModel** instance as the **BindingContext** of chart; this is done to bind properties of **ViewModel** to SfCircularChart.
77
75
78
-
> Note: Add namespace of ViewModel class in your XAML page if you prefer to set BindingContext in XAML.
76
+
> **Note:** Add namespace of ViewModel class in your XAML page if you prefer to set BindingContext in XAML.
79
77
80
78
**[XAML]**
81
79
@@ -97,26 +95,26 @@ chart.BindingContext = new ViewModel();
97
95
98
96
## How to populate data in .NET MAUI Pie Charts
99
97
100
-
As we are going to visualize the comparison of annual population of various countries in the data model, add PieSeries to SfCircularChart.Series property, and then bind the Data property of the above ViewModel to the PieSeries.ItemsSource property as shown below.
98
+
As we are going to visualize the comparison of annual population of various countries in the data model, add [PieSeries](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.PieSeries.html?tabs=tabid-1) to [SfCircularChart.Series](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.SfCircularChart.html#Syncfusion_Maui_Charts_SfCircularChart_Series) property, and then bind the Data property of the above ViewModel to the [PieSeries.ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html?&_ga=2.202111828.471182244.1634019879-255829655.1613129491#Syncfusion_Maui_Charts_ChartSeries_ItemsSource) property as shown below.
101
99
102
-
> Note: Need to set XBindingPath and YBindingPath properties, so that series would fetch values from the respective properties in the data model to plot the series.
100
+
> **Note:** Need to set [XBindingPath](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_XBindingPath) and [YBindingPath](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.XYDataSeries.html#Syncfusion_Maui_Charts_XYDataSeries_YBindingPath) properties, so that series would fetch values from the respective properties in the data model to plot the series.
0 commit comments