Skip to content

Commit b086a0d

Browse files
Added sample
1 parent 4038e74 commit b086a0d

39 files changed

+1246
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.10.35027.167
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisplayTrackballValues", "DisplayTrackballValues\DisplayTrackballValues.csproj", "{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}"
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+
{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{CBDBBD45-3C8E-42A5-A282-D1AFC1E0861D}.Release|Any CPU.Deploy.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ExtensibilityGlobals) = postSolution
25+
SolutionGuid = {3FE2B269-B05B-4E5A-BE28-C1D888F7C384}
26+
EndGlobalSection
27+
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:DisplayTrackballValues"
5+
x:Class="DisplayTrackballValues.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 DisplayTrackballValues
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}
12+
}
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="DisplayTrackballValues.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:DisplayTrackballValues"
7+
Shell.FlyoutBehavior="Disabled"
8+
Title="DisplayTrackballValues">
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 DisplayTrackballValues
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.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);net8.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>DisplayTrackballValues</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<Nullable>enable</Nullable>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>DisplayTrackballValues</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.displaytrackballvalues</ApplicationId>
28+
29+
<!-- Versions -->
30+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
31+
<ApplicationVersion>1</ApplicationVersion>
32+
33+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
34+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
35+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
36+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
37+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
38+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
39+
</PropertyGroup>
40+
41+
<ItemGroup>
42+
<!-- App Icon -->
43+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
44+
45+
<!-- Splash Screen -->
46+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
47+
48+
<!-- Images -->
49+
<MauiImage Include="Resources\Images\*" />
50+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
51+
52+
<!-- Custom Fonts -->
53+
<MauiFont Include="Resources\Fonts\*" />
54+
55+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
56+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
57+
</ItemGroup>
58+
59+
<ItemGroup>
60+
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.92" />
61+
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.92" />
62+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
63+
<PackageReference Include="Syncfusion.Maui.Charts" Version="*" />
64+
<PackageReference Include="Syncfusion.Maui.ListView" Version="*" />
65+
</ItemGroup>
66+
67+
</Project>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
x:Class="DisplayTrackballValues.MainPage"
5+
xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"
6+
xmlns:listView="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
7+
xmlns:local="clr-namespace:DisplayTrackballValues">
8+
9+
<ContentPage.BindingContext>
10+
<local:ViewModel x:Name="viewModel"/>
11+
</ContentPage.BindingContext>
12+
13+
<Grid>
14+
<Grid.ColumnDefinitions>
15+
<ColumnDefinition Width="8*"/>
16+
<ColumnDefinition Width="2*"/>
17+
</Grid.ColumnDefinitions>
18+
19+
<chart:SfCartesianChart x:Name="chart" Grid.Column="0" TrackballCreated="chart_TrackballCreated">
20+
21+
<chart:SfCartesianChart.XAxes>
22+
<chart:DateTimeAxis />
23+
</chart:SfCartesianChart.XAxes>
24+
25+
<chart:SfCartesianChart.YAxes>
26+
<chart:NumericalAxis/>
27+
</chart:SfCartesianChart.YAxes>
28+
29+
<chart:SfCartesianChart.TrackballBehavior>
30+
<chart:ChartTrackballBehavior ShowLabel="False"/>
31+
</chart:SfCartesianChart.TrackballBehavior>
32+
33+
<chart:LineSeries ItemsSource="{Binding Data}"
34+
StrokeWidth="3"
35+
XBindingPath="Date"
36+
YBindingPath="YValue1"
37+
ShowTrackballLabel="True"
38+
Fill="Pink"/>
39+
<chart:LineSeries ItemsSource="{Binding Data}"
40+
StrokeWidth="3"
41+
XBindingPath="Date"
42+
YBindingPath="YValue2"
43+
ShowTrackballLabel="True"
44+
Fill="LightBlue"/>
45+
<chart:LineSeries ItemsSource="{Binding Data}"
46+
StrokeWidth="3"
47+
XBindingPath="Date"
48+
YBindingPath="YValue3"
49+
ShowTrackballLabel="True"
50+
Fill="LightGreen"/>
51+
52+
</chart:SfCartesianChart>
53+
<VerticalStackLayout Grid.Column="1">
54+
<Label HorizontalOptions="Center" Text="Trackball Values" FontAttributes="Bold"/>
55+
<ListView x:Name="listView" >
56+
<ListView.ItemTemplate>
57+
<DataTemplate>
58+
<ViewCell>
59+
<Frame Background="{Binding Series.Fill}" CornerRadius="8" Margin="5" BorderColor="Gray">
60+
<HorizontalStackLayout HorizontalOptions="Center" Spacing="10" VerticalOptions="Center" >
61+
<Label Text="{Binding DataItem.Date, StringFormat='{0:dd/MM/yyyy}'}"
62+
FontSize="14"
63+
FontAttributes="Bold"
64+
TextColor="Black"
65+
VerticalOptions="Center"/>
66+
<Label Text=" : "
67+
FontSize="14"
68+
FontAttributes="Bold"
69+
TextColor="Black"
70+
VerticalOptions="Center"/>
71+
<Label Text="{Binding Label}"
72+
FontSize="14"
73+
FontAttributes="Bold"
74+
TextColor="Black"
75+
VerticalOptions="Center"/>
76+
</HorizontalStackLayout>
77+
</Frame>
78+
</ViewCell>
79+
</DataTemplate>
80+
</ListView.ItemTemplate>
81+
</ListView>
82+
</VerticalStackLayout>
83+
84+
</Grid>
85+
86+
</ContentPage>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Syncfusion.Maui.Charts;
2+
3+
namespace DisplayTrackballValues
4+
{
5+
public partial class MainPage : ContentPage
6+
{
7+
public MainPage()
8+
{
9+
InitializeComponent();
10+
}
11+
12+
private void chart_TrackballCreated(object sender, TrackballEventArgs e)
13+
{
14+
listView.ItemsSource = e.TrackballPointsInfo.ToList();
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 DisplayTrackballValues
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 DisplayTrackballValues
8+
{
9+
public class Model
10+
{
11+
public DateTime Date { get; set; }
12+
public double YValue1 { get; set; }
13+
public double YValue2 { get; set; }
14+
public double YValue3 { get; set; }
15+
}
16+
}

0 commit comments

Comments
 (0)