@@ -76,7 +76,7 @@ Now, let us define a simple data model that represents a data point on the chart
7676
7777###### C#
7878``` C#
79- public class PlantData
79+ public class PlantModel
8080 {
8181 public string Direction { get ; set ; }
8282 public double Tree { get ; set ; }
@@ -85,34 +85,34 @@ Now, let us define a simple data model that represents a data point on the chart
8585 }
8686```
8787
88- Next, create a view model class and initialize a list of ` PlantData ` objects as follows.
88+ Next, create a PlantViewModel class and initialize a list of ` PlantModel ` objects as follows.
8989
9090######
9191``` C#
92- public class ViewModel
92+ public class PlantViewModel
9393 {
94- public List <PlantData > PlantDetails { get ; set ; }
94+ public List <PlantModel > PlantDetails { get ; set ; }
9595
96- public ViewModel ()
96+ public PlantViewModel ()
9797 {
98- PlantDetails = new List <PlantData >()
98+ PlantDetails = new List <PlantModel >()
9999 {
100- new PlantData (){ Direction = " North" , Tree = 80 , Flower = 42 , Weed = 63 },
101- new PlantData (){ Direction = " NorthEast" , Tree = 85 , Flower = 40 , Weed = 70 },
102- new PlantData (){ Direction = " East" , Tree = 78 , Flower = 47 , Weed = 65 },
103- new PlantData (){ Direction = " SouthEast" , Tree = 90 , Flower = 40 , Weed = 70 },
104- new PlantData (){ Direction = " South" , Tree = 78 , Flower = 27 , Weed = 47 },
105- new PlantData (){ Direction = " SouthWest" , Tree = 83 , Flower = 45 , Weed = 65 },
106- new PlantData (){ Direction = " West" , Tree = 79 , Flower = 40 , Weed = 58 },
107- new PlantData (){ Direction = " NorthWest" , Tree = 88 , Flower = 38 , Weed = 73 }
100+ new PlantModel (){ Direction = " North" , Tree = 80 , Flower = 42 , Weed = 63 },
101+ new PlantModel (){ Direction = " NorthEast" , Tree = 85 , Flower = 40 , Weed = 70 },
102+ new PlantModel (){ Direction = " East" , Tree = 78 , Flower = 47 , Weed = 65 },
103+ new PlantModel (){ Direction = " SouthEast" , Tree = 90 , Flower = 40 , Weed = 70 },
104+ new PlantModel (){ Direction = " South" , Tree = 78 , Flower = 27 , Weed = 47 },
105+ new PlantModel (){ Direction = " SouthWest" , Tree = 83 , Flower = 45 , Weed = 65 },
106+ new PlantModel (){ Direction = " West" , Tree = 79 , Flower = 40 , Weed = 58 },
107+ new PlantModel (){ Direction = " NorthWest" , Tree = 88 , Flower = 38 , Weed = 73 }
108108 };
109109 }
110110 }
111111```
112112
113- Create a ` ViewModel ` instance and set it as the chart's ` BindingContext ` . This enables property binding from the ` ViewModel ` class.
113+ Create a ` PlantViewModel ` instance and set it as the chart's ` BindingContext ` . This enables property binding from the ` PlantViewModel ` class.
114114
115- * Add the namespace of the ` ViewModel ` class to your XAML page, if you prefer to set the ` BindingContext ` in XAML.
115+ * Add the namespace of the ` PlantViewModel ` class to your XAML page, if you prefer to set the ` BindingContext ` in XAML.
116116
117117###### Xaml
118118``` xaml
@@ -124,14 +124,14 @@ Create a `ViewModel` instance and set it as the chart's `BindingContext`. This e
124124 xmlns : model =" clr-namespace:ChartGettingStarted" >
125125
126126 <ContentPage .BindingContext>
127- <model : ViewModel ></ model : ViewModel >
127+ <model : PlantViewModel / >
128128 </ContentPage .BindingContext>
129129</ContentPage >
130130```
131131
132132###### C#
133133``` C#
134- this .BindingContext = new ViewModel ();
134+ this .BindingContext = new PlantViewModel ();
135135```
136136
137137## Initialize Chart axis
@@ -162,7 +162,7 @@ chart.SecondaryAxis = secondaryAxis;
162162
163163## Populate Chart with data
164164
165- To create a polar chart, you can add a [ PolarLineSeries] ( https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.PolarLineSeries.html?tabs=tabid-1%2Ctabid-4 ) to the polar chart [ Series] ( https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.SfPolarChart.html#Syncfusion_Maui_Charts_SfPolarChart_Series ) property of the chart, and then bind the ` PlantData ` property of the above ` ViewModel ` to the ` PolarLineSeries.ItemsSource ` as follows.
165+ To create a polar chart, you can add a [ PolarLineSeries] ( https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.PolarLineSeries.html ) to the polar chart [ Series] ( https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.SfPolarChart.html#Syncfusion_Maui_Charts_SfPolarChart_Series ) property of the chart, and then bind the ` PlantDetails ` property of the above ` PlantViewModel ` to the ` PolarLineSeries.ItemsSource ` as follows.
166166
167167* In order to plot the series, the [ 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 need to be configured correctly. These properties allow the chart to retrieve values from the corresponding properties in the data model.
168168
@@ -204,17 +204,17 @@ chart.SecondaryAxis = secondaryAxis;
204204
205205// Initialize the series
206206PolarLineSeries series1 = new PolarLineSeries ();
207- series1 .ItemsSource = (new ViewModel ()).PlantDetails ;
207+ series1 .ItemsSource = (new PlantViewModel ()).PlantDetails ;
208208series1 .XBindingPath = " Direction" ;
209209series1 .YBindingPath = " Tree" ;
210210
211211PolarLineSeries series2 = new PolarLineSeries ();
212- series2 .ItemsSource = (new ViewModel ()).PlantDetails ;
212+ series2 .ItemsSource = (new PlantViewModel ()).PlantDetails ;
213213series2 .XBindingPath = " Direction" ;
214214series2 .YBindingPath = " Weed" ;
215215
216216PolarLineSeries series3 = new PolarLineSeries ();
217- series3 .ItemsSource = (new ViewModel ()).PlantDetails ;
217+ series3 .ItemsSource = (new PlantViewModel ()).PlantDetails ;
218218series3 .XBindingPath = " Direction" ;
219219series3 .YBindingPath = " Flower" ;
220220
@@ -312,19 +312,19 @@ chart.Legend = new ChartLegend();
312312###### C#
313313``` C#
314314PolarLineSeries series1 = new PolarLineSeries ();
315- series1 .ItemsSource = (new ViewModel ()).PlantDetails ;
315+ series1 .ItemsSource = (new PlantViewModel ()).PlantDetails ;
316316series1 .XBindingPath = " Direction" ;
317317series1 .YBindingPath = " Tree" ;
318318series1 .Label = " Tree" ;
319319
320320PolarLineSeries series2 = new PolarLineSeries ();
321- series2 .ItemsSource = (new ViewModel ()).PlantDetails ;
321+ series2 .ItemsSource = (new PlantViewModel ()).PlantDetails ;
322322series2 .XBindingPath = " Direction" ;
323323series2 .YBindingPath = " Weed" ;
324324series2 .Label = " Weed" ;
325325
326326PolarLineSeries series3 = new PolarLineSeries ();
327- series3 .ItemsSource = (new ViewModel ()).PlantDetails ;
327+ series3 .ItemsSource = (new PlantViewModel ()).PlantDetails ;
328328series3 .XBindingPath = " Direction" ;
329329series3 .YBindingPath = " Flower" ;
330330series3 .Label = " Flower" ;
@@ -361,7 +361,7 @@ The following code example gives you the complete code of above configurations.
361361 xmlns : model =" clr-namespace:ChartGettingStarted" >
362362
363363 <ContentPage .BindingContext>
364- <model : ViewModel ></ model : ViewModel >
364+ <model : PlantViewModel / >
365365 </ContentPage .BindingContext>
366366
367367 <ContentPage .Content>
@@ -426,7 +426,7 @@ The following code example gives you the complete code of above configurations.
426426
427427 PolarLineSeries series1 = new PolarLineSeries ()
428428 {
429- ItemsSource = (new ViewModel ()).PlantDetails ,
429+ ItemsSource = (new PlantViewModel ()).PlantDetails ,
430430 XBindingPath = " Direction" ,
431431 YBindingPath = " Tree" ,
432432 Label = " Tree" ,
@@ -436,7 +436,7 @@ The following code example gives you the complete code of above configurations.
436436
437437 PolarLineSeries series2 = new PolarLineSeries ()
438438 {
439- ItemsSource = (new ViewModel ()).PlantDetails ,
439+ ItemsSource = (new PlantViewModel ()).PlantDetails ,
440440 XBindingPath = " Direction" ,
441441 YBindingPath = " Weed" ,
442442 Label = " Weed" ,
@@ -446,7 +446,7 @@ The following code example gives you the complete code of above configurations.
446446
447447 PolarLineSeries series3 = new PolarLineSeries ()
448448 {
449- ItemsSource = (new ViewModel ()).PlantDetails ,
449+ ItemsSource = (new PlantViewModel ()).PlantDetails ,
450450 XBindingPath = " Direction" ,
451451 YBindingPath = " Flower" ,
452452 Label = " Flower" ,
0 commit comments