Skip to content

Commit 6dc3e1d

Browse files
attach the blog sample
1 parent eaf4789 commit 6dc3e1d

40 files changed

+9168
-0
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="28.2.4" />
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: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
<Grid.ColumnDefinitions>
25+
<ColumnDefinition Width="{OnPlatform Android=20, Default=40, iOS=15}"/>
26+
<ColumnDefinition Width="Auto"/>
27+
</Grid.ColumnDefinitions>
28+
<BoxView Grid.Column="0" Grid.RowSpan="2" BackgroundColor="Blue" Margin="0,-20,0,0" HeightRequest="45" WidthRequest="20" />
29+
<StackLayout Grid.Column="1" Grid.Row="0" Margin="7,7,0,0">
30+
<Label Text="Comparative Analysis of Product Performance" FontSize="{OnPlatform Android=15,Default=18,iOS=15}" FontAttributes="Bold"/>
31+
<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"/>
32+
</StackLayout>
33+
</Grid>
34+
35+
<Grid Grid.Row="1">
36+
<VerticalStackLayout BindableLayout.ItemsSource="{Binding BulletChartData}" x:Name="layout" Spacing="{OnPlatform Default=70, WinUI=40, Android=40}">
37+
<BindableLayout.ItemTemplate>
38+
<DataTemplate>
39+
<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}">
40+
41+
<gauge:SfLinearGauge.MajorTickStyle>
42+
<gauge:LinearTickStyle Stroke="Black"/>
43+
</gauge:SfLinearGauge.MajorTickStyle>
44+
45+
<gauge:SfLinearGauge.Ranges>
46+
<gauge:LinearRange EndValue="{Binding LowRange}"
47+
StartWidth="{OnPlatform Android=60, Default=50, iOS=30}"
48+
EndWidth="{OnPlatform Android=60, Default=50, iOS=30}"
49+
Position="Cross" Fill="#668ae6"/>
50+
51+
<gauge:LinearRange StartValue="{Binding LowRange}"
52+
EndValue="{Binding MidRange}"
53+
StartWidth="{OnPlatform Android=60, Default=50, iOS=30}"
54+
EndWidth="{OnPlatform Android=60, Default=50, iOS=30}"
55+
Fill="#a6bfe6"
56+
Position="Cross" />
57+
58+
<gauge:LinearRange StartValue="{Binding MidRange}"
59+
EndValue="{Binding HighRange}"
60+
StartWidth="{OnPlatform Android=60, Default=50, iOS=30}"
61+
EndWidth="{OnPlatform Android=60, Default=50, iOS=30}"
62+
Fill="#d9e0ff"
63+
Position="Cross" />
64+
</gauge:SfLinearGauge.Ranges>
65+
66+
<gauge:SfLinearGauge.BarPointers>
67+
<gauge:BarPointer Value="{Binding ObservedValue}"
68+
PointerSize="{OnPlatform Android=8, Default=8, iOS=6}"
69+
Fill="#003bcc"/>
70+
</gauge:SfLinearGauge.BarPointers>
71+
72+
<gauge:SfLinearGauge.MarkerPointers>
73+
74+
<gauge:LinearShapePointer ShapeType="Rectangle"
75+
Value="{Binding TargetValue}"
76+
Fill="#003f5c"
77+
ShapeWidth="{OnPlatform Android=2, Default=4, iOS=2}"
78+
ShapeHeight="{OnPlatform Android=40, Default=30}"
79+
Position="Cross"/>
80+
81+
<gauge:LinearContentPointer Value="{OnPlatform Android=4, iOS=5, Default=0}"
82+
OffsetX="{OnPlatform Android=-10, iOS=-10, Default=-15}"
83+
OffsetY="{OnPlatform Android=10, iOS=10, Default=10}"
84+
Alignment="{OnPlatform Android=Start, iOS=Start, Default=Start}">
85+
<gauge:LinearContentPointer.Content>
86+
<Label Text="{Binding BindingContext.Category}"/>
87+
</gauge:LinearContentPointer.Content>
88+
</gauge:LinearContentPointer>
89+
90+
</gauge:SfLinearGauge.MarkerPointers>
91+
</gauge:SfLinearGauge>
92+
</DataTemplate>
93+
</BindableLayout.ItemTemplate>
94+
</VerticalStackLayout>
95+
</Grid>
96+
</Grid>
97+
98+
</Border>
99+
100+
</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)