Skip to content

Commit 823dcf2

Browse files
Merge pull request #1 from SyncfusionExamples/Prepare-getting-started-sample-for-polar-chart
Prepare getting started sample for polar chart
2 parents a6150e2 + 10150c5 commit 823dcf2

40 files changed

Lines changed: 1530 additions & 2 deletions
44.3 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:PolarChartSample"
5+
x:Class="PolarChartSample.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace PolarChartSample
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="PolarChartSample.AppShell"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:local="clr-namespace:PolarChartSample"
7+
Shell.FlyoutBehavior="Disabled"
8+
Title="PolarChartSample">
9+
10+
<ShellContent
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace PolarChartSample
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:model="clr-namespace:PolarChartSample"
5+
xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"
6+
x:Class="PolarChartSample.MainPage">
7+
8+
<ContentPage.BindingContext>
9+
<model:ViewModel/>
10+
</ContentPage.BindingContext>
11+
12+
<chart:SfPolarChart>
13+
14+
<chart:SfPolarChart.Title>
15+
<Label Text="Plant Analysis" HorizontalTextAlignment="Center"/>
16+
</chart:SfPolarChart.Title>
17+
18+
<chart:SfPolarChart.Legend>
19+
<chart:ChartLegend/>
20+
</chart:SfPolarChart.Legend>
21+
22+
<chart:SfPolarChart.PrimaryAxis>
23+
<chart:CategoryAxis/>
24+
</chart:SfPolarChart.PrimaryAxis>
25+
26+
<chart:SfPolarChart.SecondaryAxis>
27+
<chart:NumericalAxis/>
28+
</chart:SfPolarChart.SecondaryAxis>
29+
30+
<chart:PolarAreaSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction"
31+
YBindingPath="Tree" Label="Tree" EnableTooltip="True" ShowDataLabels="True"/>
32+
33+
<chart:PolarAreaSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction"
34+
YBindingPath="Weed" Label="Weed" EnableTooltip="True" ShowDataLabels="True"/>
35+
36+
<chart:PolarAreaSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction"
37+
YBindingPath="Flower" Label="Flower" EnableTooltip="True" ShowDataLabels="True"/>
38+
</chart:SfPolarChart>
39+
40+
41+
</ContentPage>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Syncfusion.Maui.Charts;
2+
3+
namespace PolarChartSample
4+
{
5+
public partial class MainPage : ContentPage
6+
{
7+
public MainPage()
8+
{
9+
InitializeComponent();
10+
11+
//this.BindingContext = new ViewModel();
12+
//SfPolarChart polarChart = new SfPolarChart();
13+
//polarChart.Title = new Label() { Text = "Plant Analysis", HorizontalTextAlignment = TextAlignment.Center };
14+
//polarChart.Legend = new ChartLegend();
15+
//polarChart.PrimaryAxis = new CategoryAxis();
16+
//polarChart.SecondaryAxis = new NumericalAxis();
17+
18+
//PolarAreaSeries series1 = new PolarAreaSeries()
19+
//{
20+
// ItemsSource = (new ViewModel()).PlantDetails,
21+
// XBindingPath = "Direction",
22+
// YBindingPath = "Tree",
23+
// Label = "Tree",
24+
// EnableTooltip = true,
25+
// ShowDataLabels = true,
26+
//};
27+
28+
//PolarAreaSeries series2 = new PolarAreaSeries()
29+
//{
30+
// ItemsSource = (new ViewModel()).PlantDetails,
31+
// XBindingPath = "Direction",
32+
// YBindingPath = "Weed",
33+
// Label = "Weed",
34+
// EnableTooltip = true,
35+
// ShowDataLabels = true,
36+
//};
37+
38+
//PolarAreaSeries series3 = new PolarAreaSeries()
39+
//{
40+
// ItemsSource = (new ViewModel()).PlantDetails,
41+
// XBindingPath = "Direction",
42+
// YBindingPath = "Flower",
43+
// Label = "Flower",
44+
// EnableTooltip = true,
45+
// ShowDataLabels = true,
46+
//};
47+
48+
//polarChart.Series.Add(series1);
49+
//polarChart.Series.Add(series2);
50+
//polarChart.Series.Add(series3);
51+
//this.Content = polarChart;
52+
}
53+
}
54+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
namespace PolarChartSample
5+
{
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder
12+
.UseMauiApp<App>()
13+
.ConfigureSyncfusionCore()
14+
.ConfigureFonts(fonts =>
15+
{
16+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
17+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
18+
});
19+
20+
#if DEBUG
21+
builder.Logging.AddDebug();
22+
#endif
23+
24+
return builder.Build();
25+
}
26+
}
27+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace PolarChartSample
8+
{
9+
public class Model
10+
{
11+
public string? Direction { get; set; }
12+
public double Tree { get; set; }
13+
public double Flower { get; set; }
14+
public double Weed { get; set; }
15+
}
16+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
4+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
</manifest>

0 commit comments

Comments
 (0)