Skip to content

Commit 55bcb65

Browse files
Merge pull request #4 from SyncfusionExamples/892143-Updated-Code-in-the-Polar-chart-sample
892143- Updated C# code in Polar chart sample
2 parents 9d257bf + 460bcdc commit 55bcb65

File tree

2 files changed

+55
-48
lines changed

2 files changed

+55
-48
lines changed

Polar_chart_sample/PolarChartSample/MainPage.xaml.cs

+7-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ public MainPage()
1313
//polarChart.Title = new Label() { Text = "Plant Analysis", HorizontalTextAlignment = TextAlignment.Center };
1414
//polarChart.Legend = new ChartLegend();
1515
//polarChart.PrimaryAxis = new CategoryAxis();
16-
//polarChart.SecondaryAxis = new NumericalAxis();
16+
//polarChart.SecondaryAxis = new NumericalAxis()
17+
//{
18+
// Maximum = 100
19+
//};
1720

18-
//PolarAreaSeries series1 = new PolarAreaSeries()
21+
//PolarLineSeries series1 = new PolarLineSeries()
1922
//{
2023
// ItemsSource = (new ViewModel()).PlantDetails,
2124
// XBindingPath = "Direction",
@@ -25,7 +28,7 @@ public MainPage()
2528
// ShowDataLabels = true,
2629
//};
2730

28-
//PolarAreaSeries series2 = new PolarAreaSeries()
31+
//PolarLineSeries series2 = new PolarLineSeries()
2932
//{
3033
// ItemsSource = (new ViewModel()).PlantDetails,
3134
// XBindingPath = "Direction",
@@ -35,7 +38,7 @@ public MainPage()
3538
// ShowDataLabels = true,
3639
//};
3740

38-
//PolarAreaSeries series3 = new PolarAreaSeries()
41+
//PolarLineSeries series3 = new PolarLineSeries()
3942
//{
4043
// ItemsSource = (new ViewModel()).PlantDetails,
4144
// XBindingPath = "Direction",

README.md

+48-44
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ To create a polar chart, you can add a [PolarLineSeries](https://help.syncfusion
179179
</chart:NumericalAxis>
180180
</chart:SfPolarChart.SecondaryAxis>
181181

182-
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction" YBindingPath="Tree" />
182+
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction" YBindingPath="Tree"/>
183183

184-
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction" YBindingPath="Weed" />
184+
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction" YBindingPath="Weed"/>
185185

186-
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction" YBindingPath="Flower" />
186+
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction" YBindingPath="Flower"/>
187187
</chart:SfPolarChart>
188188
```
189189

@@ -203,23 +203,25 @@ NumericalAxis secondaryAxis = new NumericalAxis()
203203
chart.SecondaryAxis = secondaryAxis;
204204

205205
//Initialize the series
206-
PolarLineSeries series = new PolarLineSeries();
207-
series.ItemsSource = (new ViewModel()).PlantDetails;
208-
series.XBindingPath = "Direction";
209-
series.YBindingPath = "Tree";
206+
PolarLineSeries series1 = new PolarLineSeries();
207+
series1.ItemsSource = (new ViewModel()).PlantDetails;
208+
series1.XBindingPath = "Direction";
209+
series1.YBindingPath = "Tree";
210210

211-
PolarLineSeries series = new PolarLineSeries();
212-
series.ItemsSource = (new ViewModel()).PlantDetails;
213-
series.XBindingPath = "Direction";
214-
series.YBindingPath = "Weed";
211+
PolarLineSeries series2 = new PolarLineSeries();
212+
series2.ItemsSource = (new ViewModel()).PlantDetails;
213+
series2.XBindingPath = "Direction";
214+
series2.YBindingPath = "Weed";
215215

216-
PolarLineSeries series = new PolarLineSeries();
217-
series.ItemsSource = (new ViewModel()).PlantDetails;
218-
series.XBindingPath = "Direction";
219-
series.YBindingPath = "Flower";
216+
PolarLineSeries series3 = new PolarLineSeries();
217+
series3.ItemsSource = (new ViewModel()).PlantDetails;
218+
series3.XBindingPath = "Direction";
219+
series3.YBindingPath = "Flower";
220220

221221
//Adding Series to the Chart Series Collection
222-
chart.Series.Add(series);
222+
chart.Series.Add(series1);
223+
chart.Series.Add(series2);
224+
chart.Series.Add(series3);
223225
```
224226

225227
## Add a title
@@ -256,17 +258,17 @@ The [ShowDataLabels](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.
256258
<chart:SfPolarChart>
257259
. . .
258260
<chart:PolarLineSeries ShowDataLabels="True">
259-
</chart:PolarLineSeries >
261+
</chart:PolarLineSeries>
260262
</chart:SfPolarChart>
261263
```
262264

263265
###### C#
264266
```C#
265267
SfPolarChart chart = new SfPolarChart()
266268
. . .
267-
PolarLineSeries series = new PolarLineSeries();
268-
series.ShowDataLabels = true;
269-
chart.Series.Add(series);
269+
PolarLineSeries series1 = new PolarLineSeries();
270+
series1.ShowDataLabels = true;
271+
chart.Series.Add(series1);
270272
```
271273

272274
## Enable a legend
@@ -275,7 +277,7 @@ The legend provides information about the data point displayed in the chart. The
275277

276278
###### Xaml
277279
```xaml
278-
<chart:SfPolarChart >
280+
<chart:SfPolarChart>
279281
. . .
280282
<chart:SfPolarChart.Legend>
281283
<chart:ChartLegend/>
@@ -309,23 +311,23 @@ chart.Legend = new ChartLegend();
309311

310312
###### C#
311313
```C#
312-
PolarLineSeries series = new PolarLineSeries();
313-
series.ItemsSource = (new ViewModel()).PlantDetails;
314-
series.XBindingPath = "Direction";
315-
series.YBindingPath = "Tree";
316-
series.Label = "Tree";
317-
318-
PolarLineSeries series = new PolarLineSeries();
319-
series.ItemsSource = (new ViewModel()).PlantDetails;
320-
series.XBindingPath = "Direction";
321-
series.YBindingPath = "Weed";
322-
series.Label = "Weed";
323-
324-
PolarLineSeries series = new PolarLineSeries();
325-
series.ItemsSource = (new ViewModel()).PlantDetails;
326-
series.XBindingPath = "Direction";
327-
series.YBindingPath = "Flower";
328-
series.Label = "Flower";
314+
PolarLineSeries series1 = new PolarLineSeries();
315+
series1.ItemsSource = (new ViewModel()).PlantDetails;
316+
series1.XBindingPath = "Direction";
317+
series1.YBindingPath = "Tree";
318+
series1.Label = "Tree";
319+
320+
PolarLineSeries series2 = new PolarLineSeries();
321+
series2.ItemsSource = (new ViewModel()).PlantDetails;
322+
series2.XBindingPath = "Direction";
323+
series2.YBindingPath = "Weed";
324+
series2.Label = "Weed";
325+
326+
PolarLineSeries series3 = new PolarLineSeries();
327+
series3.ItemsSource = (new ViewModel()).PlantDetails;
328+
series3.XBindingPath = "Direction";
329+
series3.YBindingPath = "Flower";
330+
series3.Label = "Flower";
329331
```
330332

331333
## Enable tooltip
@@ -343,8 +345,8 @@ Tooltips are used to display information about a segment when a user hovers over
343345

344346
###### C#
345347
```C#
346-
PolarLineSeries series = new PolarLineSeries();
347-
series.EnableTooltip = true;
348+
PolarLineSeries series1 = new PolarLineSeries();
349+
series1.EnableTooltip = true;
348350
```
349351

350352
The following code example gives you the complete code of above configurations.
@@ -422,7 +424,7 @@ The following code example gives you the complete code of above configurations.
422424
};
423425
chart.SecondaryAxis = secondaryAxis;
424426

425-
PolarLineSeries series = new PolarLineSeries()
427+
PolarLineSeries series1 = new PolarLineSeries()
426428
{
427429
ItemsSource = (new ViewModel()).PlantDetails,
428430
XBindingPath = "Direction",
@@ -432,7 +434,7 @@ The following code example gives you the complete code of above configurations.
432434
ShowDataLabels="True"
433435
};
434436

435-
PolarLineSeries series = new PolarLineSeries()
437+
PolarLineSeries series2 = new PolarLineSeries()
436438
{
437439
ItemsSource = (new ViewModel()).PlantDetails,
438440
XBindingPath = "Direction",
@@ -442,7 +444,7 @@ The following code example gives you the complete code of above configurations.
442444
ShowDataLabels="True"
443445
};
444446

445-
PolarLineSeries series = new PolarLineSeries()
447+
PolarLineSeries series3 = new PolarLineSeries()
446448
{
447449
ItemsSource = (new ViewModel()).PlantDetails,
448450
XBindingPath = "Direction",
@@ -452,7 +454,9 @@ The following code example gives you the complete code of above configurations.
452454
ShowDataLabels="True"
453455
};
454456

455-
chart.Series.Add(series);
457+
chart.Series.Add(series1);
458+
chart.Series.Add(series2);
459+
chart.Series.Add(series3);
456460
this.Content = chart;
457461
}
458462
}

0 commit comments

Comments
 (0)