Skip to content

Commit 226cbd3

Browse files
added new sample
1 parent 238d44e commit 226cbd3

37 files changed

Lines changed: 1147 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="PolarChartSample/PolarChartSample.csproj" />
3+
</Solution>
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
3+
namespace PolarChartSample
4+
{
5+
public partial class App : Application
6+
{
7+
public App()
8+
{
9+
InitializeComponent();
10+
}
11+
12+
protected override Window CreateWindow(IActivationState? activationState)
13+
{
14+
return new Window(new AppShell());
15+
}
16+
}
17+
}
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+
Title="PolarChartSample">
8+
9+
<ShellContent
10+
Title="Home"
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:PlantViewModel/>
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 Maximum="100"/>
28+
</chart:SfPolarChart.SecondaryAxis>
29+
30+
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction"
31+
YBindingPath="Tree" Label="Tree" EnableTooltip="True" ShowDataLabels="True"/>
32+
33+
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction"
34+
YBindingPath="Weed" Label="Weed" EnableTooltip="True" ShowDataLabels="True"/>
35+
36+
<chart:PolarLineSeries ItemsSource="{Binding PlantDetails}" XBindingPath="Direction"
37+
YBindingPath="Flower" Label="Flower" EnableTooltip="True" ShowDataLabels="True"/>
38+
</chart:SfPolarChart>
39+
40+
41+
</ContentPage>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
// Maximum = 100
19+
//};
20+
21+
//PolarLineSeries series1 = new PolarLineSeries()
22+
//{
23+
// ItemsSource = (new ViewModel()).PlantDetails,
24+
// XBindingPath = "Direction",
25+
// YBindingPath = "Tree",
26+
// Label = "Tree",
27+
// EnableTooltip = true,
28+
// ShowDataLabels = true,
29+
//};
30+
31+
//PolarLineSeries series2 = new PolarLineSeries()
32+
//{
33+
// ItemsSource = (new ViewModel()).PlantDetails,
34+
// XBindingPath = "Direction",
35+
// YBindingPath = "Weed",
36+
// Label = "Weed",
37+
// EnableTooltip = true,
38+
// ShowDataLabels = true,
39+
//};
40+
41+
//PolarLineSeries series3 = new PolarLineSeries()
42+
//{
43+
// ItemsSource = (new ViewModel()).PlantDetails,
44+
// XBindingPath = "Direction",
45+
// YBindingPath = "Flower",
46+
// Label = "Flower",
47+
// EnableTooltip = true,
48+
// ShowDataLabels = true,
49+
//};
50+
51+
//polarChart.Series.Add(series1);
52+
//polarChart.Series.Add(series2);
53+
//polarChart.Series.Add(series3);
54+
//this.Content = polarChart;
55+
}
56+
}
57+
}
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 PlantModel
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)