Skip to content

Commit ebabe48

Browse files
Merge pull request #1 from SyncfusionExamples/Attach_the_blog_sample
MAUI 895081-Attach the Bullet Chart blog sample
2 parents 22eb112 + 9d5b006 commit ebabe48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+9201
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35527.113
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BulletChartSample", "BulletChartSample\BulletChartSample.csproj", "{03CECD24-C8F6-41A6-86A0-CC8B2621E841}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{03CECD24-C8F6-41A6-86A0-CC8B2621E841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{03CECD24-C8F6-41A6-86A0-CC8B2621E841}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{03CECD24-C8F6-41A6-86A0-CC8B2621E841}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{03CECD24-C8F6-41A6-86A0-CC8B2621E841}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{03CECD24-C8F6-41A6-86A0-CC8B2621E841}.Release|Any CPU.Build.0 = Release|Any CPU
19+
EndGlobalSection
20+
GlobalSection(SolutionProperties) = preSolution
21+
HideSolutionNode = FALSE
22+
EndGlobalSection
23+
EndGlobal
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:BulletChartSample"
5+
x:Class="BulletChartSample.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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace BulletChartSample
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("Ngo9BigBOggjHTQxAR8/V1NMaF1cWWhLYVFxWmFZfVtgdVdMYVlbRXFPMyBoS35Rc0VhWH5ecHRTQmZcVk1w");
8+
InitializeComponent();
9+
}
10+
11+
protected override Window CreateWindow(IActivationState? activationState)
12+
{
13+
return new Window(new MainPage());
14+
}
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="BulletChartSample.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:BulletChartSample"
7+
Shell.FlyoutBehavior="Flyout"
8+
Title="BulletChartSample">
9+
10+
<ShellContent
11+
Title="Home"
12+
ContentTemplate="{DataTemplate local:MainPage}"
13+
Route="MainPage" />
14+
15+
</Shell>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace BulletChartSample
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
6+
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
8+
9+
<!-- Note for MacCatalyst:
10+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
11+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
12+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
13+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
14+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
15+
16+
<OutputType>Exe</OutputType>
17+
<RootNamespace>BulletChartSample</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<Nullable>enable</Nullable>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>BulletChartSample</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.bulletchartsample</ApplicationId>
28+
29+
<!-- Versions -->
30+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
31+
<ApplicationVersion>1</ApplicationVersion>
32+
33+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
34+
<WindowsPackageType>None</WindowsPackageType>
35+
36+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
37+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
38+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
39+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
40+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
41+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
42+
</PropertyGroup>
43+
44+
<ItemGroup>
45+
<!-- App Icon -->
46+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
47+
48+
<!-- Splash Screen -->
49+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
50+
51+
<!-- Images -->
52+
<MauiImage Include="Resources\Images\*" />
53+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
54+
55+
<!-- Custom Fonts -->
56+
<MauiFont Include="Resources\Fonts\*" />
57+
58+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
59+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
60+
</ItemGroup>
61+
62+
<ItemGroup>
63+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
64+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
65+
<PackageReference Include="Syncfusion.Maui.Gauges" Version="*" />
66+
</ItemGroup>
67+
68+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace BulletChartSample
9+
{
10+
public class GaugeModel
11+
{
12+
public string Category { get; set; }
13+
14+
public double ObservedValue { get; set; }
15+
16+
public double TargetValue { get; set; }
17+
18+
public double LowRange { get; set; }
19+
20+
public double MidRange { get; set; }
21+
22+
public double HighRange { get; set; }
23+
24+
public bool IsAxisVisible { get; set; } = false;
25+
26+
public GaugeModel(string text, double actual, double target, double low, double mid, double high)
27+
{
28+
Category = text;
29+
ObservedValue = actual;
30+
TargetValue = target;
31+
LowRange = low;
32+
MidRange = mid;
33+
HighRange = high;
34+
}
35+
}
36+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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:gauge="clr-namespace:Syncfusion.Maui.Gauges;assembly=Syncfusion.Maui.Gauges"
5+
xmlns:local="clr-namespace:BulletChartSample"
6+
x:Class="BulletChartSample.MainPage">
7+
8+
<ContentPage.BindingContext>
9+
<local:ViewModel/>
10+
</ContentPage.BindingContext>
11+
12+
<Border StrokeShape="RoundRectangle 10" Stroke="Black" Margin="10" Padding="{OnPlatform Android=5, Default=10, iOS=5}">
13+
14+
<Grid>
15+
<Grid.RowDefinitions>
16+
<RowDefinition Height="Auto"/>
17+
<RowDefinition Height="*"/>
18+
</Grid.RowDefinitions>
19+
20+
<Grid Grid.Row="0" Margin="10">
21+
<Grid.RowDefinitions>
22+
<RowDefinition Height="{OnPlatform Android=68,Default=80,iOS=68}"/>
23+
</Grid.RowDefinitions>
24+
25+
<Grid.ColumnDefinitions>
26+
<ColumnDefinition Width="{OnPlatform Android=20, Default=40, iOS=15}"/>
27+
<ColumnDefinition Width="Auto"/>
28+
</Grid.ColumnDefinitions>
29+
30+
<BoxView Grid.Column="0" Grid.RowSpan="2" BackgroundColor="Blue" Margin="0,-20,0,0" HeightRequest="45" WidthRequest="20" />
31+
32+
<StackLayout Grid.Column="1" Grid.Row="0" Margin="7,7,0,0">
33+
<Label Text="Comparative Analysis of Product Performance" FontSize="{OnPlatform Android=15,Default=18,iOS=15}" FontAttributes="Bold"/>
34+
<Label Text="{OnPlatform Default='Evaluation of Key Performance Metrics and Competitive Benchmarking Across Market Competitors.', Android='Evaluating Key Performance Metrics and Competitive Industry Benchmarks.', iOS='Evaluating Performance Metrics and Industry Benchmarks.'}" FontSize="{OnPlatform Android=10,Default=13,iOS=10}" Margin="0,2,0,0"/>
35+
</StackLayout>
36+
</Grid>
37+
38+
<Grid Grid.Row="1">
39+
<VerticalStackLayout BindableLayout.ItemsSource="{Binding BulletChartData}" x:Name="layout" Spacing="{OnPlatform Default=70, WinUI=40, Android=40}">
40+
<BindableLayout.ItemTemplate>
41+
<DataTemplate>
42+
<gauge:SfLinearGauge Interval="40" Maximum="240" Orientation="Horizontal" MinorTicksPerInterval="0" ShowLine="False" TickOffset="{OnPlatform Android=30, Default=25, iOS=15}" ShowLabels="{Binding IsAxisVisible}" ShowTicks="{Binding IsAxisVisible}">
43+
44+
<gauge:SfLinearGauge.MajorTickStyle>
45+
<gauge:LinearTickStyle Stroke="Black"/>
46+
</gauge:SfLinearGauge.MajorTickStyle>
47+
48+
<gauge:SfLinearGauge.Ranges>
49+
<gauge:LinearRange EndValue="{Binding LowRange}"
50+
StartWidth="{OnPlatform Android=60, Default=50, iOS=30}"
51+
EndWidth="{OnPlatform Android=60, Default=50, iOS=30}"
52+
Position="Cross" Fill="#668ae6"/>
53+
54+
<gauge:LinearRange StartValue="{Binding LowRange}"
55+
EndValue="{Binding MidRange}"
56+
StartWidth="{OnPlatform Android=60, Default=50, iOS=30}"
57+
EndWidth="{OnPlatform Android=60, Default=50, iOS=30}"
58+
Fill="#a6bfe6"
59+
Position="Cross" />
60+
61+
<gauge:LinearRange StartValue="{Binding MidRange}"
62+
EndValue="{Binding HighRange}"
63+
StartWidth="{OnPlatform Android=60, Default=50, iOS=30}"
64+
EndWidth="{OnPlatform Android=60, Default=50, iOS=30}"
65+
Fill="#d9e0ff"
66+
Position="Cross" />
67+
</gauge:SfLinearGauge.Ranges>
68+
69+
<gauge:SfLinearGauge.BarPointers>
70+
<gauge:BarPointer Value="{Binding ObservedValue}"
71+
PointerSize="{OnPlatform Android=8, Default=8, iOS=6}"
72+
Fill="#003bcc"/>
73+
</gauge:SfLinearGauge.BarPointers>
74+
75+
<gauge:SfLinearGauge.MarkerPointers>
76+
77+
<gauge:LinearShapePointer ShapeType="Rectangle"
78+
Value="{Binding TargetValue}"
79+
Fill="#003f5c"
80+
ShapeWidth="{OnPlatform Android=2, Default=4, iOS=2}"
81+
ShapeHeight="{OnPlatform Android=40, Default=30}"
82+
Position="Cross"/>
83+
84+
<gauge:LinearContentPointer Value="{OnPlatform Android=4, iOS=5, Default=0}"
85+
OffsetX="{OnPlatform Android=-10, iOS=-10, Default=-15}"
86+
OffsetY="{OnPlatform Android=10, iOS=10, Default=10}"
87+
Alignment="{OnPlatform Android=Start, iOS=Start, Default=Start}">
88+
<gauge:LinearContentPointer.Content>
89+
<Label Text="{Binding BindingContext.Category}"/>
90+
</gauge:LinearContentPointer.Content>
91+
</gauge:LinearContentPointer>
92+
93+
</gauge:SfLinearGauge.MarkerPointers>
94+
</gauge:SfLinearGauge>
95+
</DataTemplate>
96+
</BindableLayout.ItemTemplate>
97+
</VerticalStackLayout>
98+
</Grid>
99+
</Grid>
100+
101+
</Border>
102+
103+
</ContentPage>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+

2+
3+
using Microsoft.Maui.Controls;
4+
using Syncfusion.Maui.Gauges;
5+
using System.Collections.ObjectModel;
6+
using System.Globalization;
7+
8+
namespace BulletChartSample
9+
{
10+
public partial class MainPage : ContentPage
11+
{
12+
public MainPage()
13+
{
14+
InitializeComponent();
15+
}
16+
17+
}
18+
}
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 BulletChartSample
5+
{
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder.ConfigureSyncfusionCore();
12+
builder
13+
.UseMauiApp<App>()
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+
}

0 commit comments

Comments
 (0)