Skip to content

Commit 8145abc

Browse files
Added new sample
1 parent e4c330f commit 8145abc

37 files changed

Lines changed: 1086 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="Chart_GettingStarted/Chart_GettingStarted.csproj" />
3+
</Solution>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Chart_GettingStarted
8+
{
9+
public class AdmissionModel
10+
{
11+
public string XValue { get; set; }
12+
public double YValue { get; set; }
13+
}
14+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Chart_GettingStarted
8+
{
9+
public class AdmissionViewModel
10+
{
11+
public List<AdmissionModel> Data { get; set; }
12+
13+
public AdmissionViewModel()
14+
{
15+
Data = new List<AdmissionModel>()
16+
{
17+
new AdmissionModel() {XValue = "Enrolled", YValue=175},
18+
new AdmissionModel() {XValue = "Admits", YValue=190},
19+
new AdmissionModel() {XValue = "Applicants", YValue=245},
20+
new AdmissionModel() {XValue = "Inquiries ", YValue=290},
21+
new AdmissionModel() {XValue = "Prospects ", YValue=320},
22+
};
23+
}
24+
}
25+
}
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:Chart_GettingStarted"
5+
x:Class="Chart_GettingStarted.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 Chart_GettingStarted
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="Chart_GettingStarted.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:Chart_GettingStarted"
7+
Title="Chart_GettingStarted">
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 Chart_GettingStarted
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net10.0-android</TargetFrameworks>
5+
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
6+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
7+
8+
<!-- Note for MacCatalyst:
9+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
10+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
11+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
12+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
13+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
14+
15+
<OutputType>Exe</OutputType>
16+
<RootNamespace>Chart_GettingStarted</RootNamespace>
17+
<UseMaui>true</UseMaui>
18+
<SingleProject>true</SingleProject>
19+
<ImplicitUsings>enable</ImplicitUsings>
20+
<Nullable>enable</Nullable>
21+
22+
<!-- Enable XAML source generation for faster build times and improved performance.
23+
This generates C# code from XAML at compile time instead of runtime inflation.
24+
To disable, remove this line.
25+
For individual files, you can override by setting Inflator metadata:
26+
<MauiXaml Update="MyPage.xaml" Inflator="Default" /> (reverts to defaults: Runtime for Debug, XamlC for Release)
27+
<MauiXaml Update="MyPage.xaml" Inflator="Runtime" /> (force runtime inflation) -->
28+
<MauiXamlInflator>SourceGen</MauiXamlInflator>
29+
30+
<!-- Display name -->
31+
<ApplicationTitle>Chart_GettingStarted</ApplicationTitle>
32+
33+
<!-- App Identifier -->
34+
<ApplicationId>com.companyname.chart_gettingstarted</ApplicationId>
35+
36+
<!-- Versions -->
37+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
38+
<ApplicationVersion>1</ApplicationVersion>
39+
40+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
41+
<WindowsPackageType>None</WindowsPackageType>
42+
43+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
44+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
45+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
46+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
47+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
48+
</PropertyGroup>
49+
50+
<ItemGroup>
51+
<!-- App Icon -->
52+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
53+
54+
<!-- Splash Screen -->
55+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
56+
57+
<!-- Images -->
58+
<MauiImage Include="Resources\Images\*" />
59+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
60+
61+
<!-- Custom Fonts -->
62+
<MauiFont Include="Resources\Fonts\*" />
63+
64+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
65+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
66+
</ItemGroup>
67+
68+
<ItemGroup>
69+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
70+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0" />
71+
</ItemGroup>
72+
73+
<ItemGroup>
74+
<PackageReference Include="Syncfusion.Maui.Charts" Version="*" />
75+
<PackageReference Include="Syncfusion.Maui.Core" Version="*" />
76+
</ItemGroup>
77+
78+
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"
5+
xmlns:model="clr-namespace:Chart_GettingStarted"
6+
x:Class="Chart_GettingStarted.MainPage">
7+
8+
<chart:SfFunnelChart ItemsSource="{Binding Data}"
9+
ShowDataLabels="True"
10+
EnableTooltip="True"
11+
XBindingPath="XValue"
12+
YBindingPath="YValue">
13+
14+
<chart:SfFunnelChart.Title>
15+
<Label Text="School Admission" HorizontalOptions="Fill" HorizontalTextAlignment="Center" VerticalOptions="Center"/>
16+
</chart:SfFunnelChart.Title>
17+
18+
<chart:SfFunnelChart.BindingContext>
19+
<model:AdmissionViewModel/>
20+
</chart:SfFunnelChart.BindingContext>
21+
22+
<chart:SfFunnelChart.Legend>
23+
<chart:ChartLegend/>
24+
</chart:SfFunnelChart.Legend>
25+
26+
</chart:SfFunnelChart>
27+
28+
</ContentPage>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Chart_GettingStarted;
2+
3+
public partial class MainPage : ContentPage
4+
{
5+
6+
public MainPage()
7+
{
8+
InitializeComponent();
9+
}
10+
}
11+

0 commit comments

Comments
 (0)