Hi Lovelesh,
Thanks for contacting Syncfusion Support.
We can achieve your requirement of creating pie chart in C# by using the following code,
C#
|
//Initialize the chart
SfChart3D chart3D = new SfChart3D(){Header= "Fruit Preferences"};
//Initialize the series
PieSeries3D pie3D = new PieSeries3D()
{
ItemsSource = new ViewModel().Collection,
XBindingPath = "XValue",
YBindingPath ="YValue",
};
//Adding series to the chart series collection
chart3D.Series.Add(pie3D);
//Setting chart as a content of MainPage
this.Content = chart3D; |
Please find the output screenshot,
We have prepared a sample for your reference and it can be downloaded from the below link,
Regards,
Durgadevi S