diff --git a/DataLabelTemplate/App.xaml b/DataLabelTemplate/App.xaml new file mode 100644 index 0000000..c9a13eb --- /dev/null +++ b/DataLabelTemplate/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/DataLabelTemplate/App.xaml.cs b/DataLabelTemplate/App.xaml.cs new file mode 100644 index 0000000..c60c19e --- /dev/null +++ b/DataLabelTemplate/App.xaml.cs @@ -0,0 +1,12 @@ +namespace DataLabelTemplate +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } + } +} diff --git a/DataLabelTemplate/AppShell.xaml b/DataLabelTemplate/AppShell.xaml new file mode 100644 index 0000000..a414946 --- /dev/null +++ b/DataLabelTemplate/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/DataLabelTemplate/AppShell.xaml.cs b/DataLabelTemplate/AppShell.xaml.cs new file mode 100644 index 0000000..98babc5 --- /dev/null +++ b/DataLabelTemplate/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace DataLabelTemplate +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/DataLabelTemplate/Convertor.cs b/DataLabelTemplate/Convertor.cs new file mode 100644 index 0000000..41e650a --- /dev/null +++ b/DataLabelTemplate/Convertor.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataLabelTemplate +{ + public class ValueToSummaryValueConverter : IValueConverter + { + private double sumOfValues = 0; + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value == null || !(value is double)) + return null; + + double numericValue = (double)value; + sumOfValues += numericValue; + if (numericValue == 0) + return sumOfValues; + else + return numericValue; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class ValueToColorConverter : IValueConverter + { + + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value == null || !(value is double)) + return Colors.Transparent; + + double numericValue = (double)value; + if (numericValue == 0) + return Color.FromHex("#3333cc"); + else + return numericValue > 0 ? Color.FromHex("#3bab46") : Color.FromHex("#df3320"); + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class ValueToImageConvertor : IValueConverter + { + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value == null || !(value is double)) + return null; + + double numericValue = (double)value; + if (numericValue == 0) + return null; + else + return numericValue > 0 ? "up.png" : "down.png"; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/DataLabelTemplate/DataLabelTemplate.csproj b/DataLabelTemplate/DataLabelTemplate.csproj new file mode 100644 index 0000000..9c584c6 --- /dev/null +++ b/DataLabelTemplate/DataLabelTemplate.csproj @@ -0,0 +1,66 @@ + + + + net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + + + + + + Exe + DataLabelTemplate + true + true + enable + enable + + + DataLabelTemplate + + + com.companyname.datalabeltemplate + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DataLabelTemplate/DataLabelTemplate.csproj.user b/DataLabelTemplate/DataLabelTemplate.csproj.user new file mode 100644 index 0000000..02aa8e8 --- /dev/null +++ b/DataLabelTemplate/DataLabelTemplate.csproj.user @@ -0,0 +1,31 @@ + + + + False + net8.0-windows10.0.19041.0 + Windows Machine + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + \ No newline at end of file diff --git a/DataLabelTemplate/DataLabelTemplate.sln b/DataLabelTemplate/DataLabelTemplate.sln new file mode 100644 index 0000000..c26adf7 --- /dev/null +++ b/DataLabelTemplate/DataLabelTemplate.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34622.214 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataLabelTemplate", "DataLabelTemplate.csproj", "{13A2C44B-3AC6-45CE-9F0B-1D17070557D0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {13A2C44B-3AC6-45CE-9F0B-1D17070557D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13A2C44B-3AC6-45CE-9F0B-1D17070557D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13A2C44B-3AC6-45CE-9F0B-1D17070557D0}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {13A2C44B-3AC6-45CE-9F0B-1D17070557D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13A2C44B-3AC6-45CE-9F0B-1D17070557D0}.Release|Any CPU.Build.0 = Release|Any CPU + {13A2C44B-3AC6-45CE-9F0B-1D17070557D0}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9D8766D1-6381-4336-BAA0-023A3227E2B8} + EndGlobalSection +EndGlobal diff --git a/DataLabelTemplate/MainPage.xaml b/DataLabelTemplate/MainPage.xaml new file mode 100644 index 0000000..d642b71 --- /dev/null +++ b/DataLabelTemplate/MainPage.xaml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DataLabelTemplate/MainPage.xaml.cs b/DataLabelTemplate/MainPage.xaml.cs new file mode 100644 index 0000000..28d2008 --- /dev/null +++ b/DataLabelTemplate/MainPage.xaml.cs @@ -0,0 +1,15 @@ +namespace DataLabelTemplate +{ + public partial class MainPage : ContentPage + { + + + public MainPage() + { + InitializeComponent(); + } + + + } + +} diff --git a/DataLabelTemplate/MauiProgram.cs b/DataLabelTemplate/MauiProgram.cs new file mode 100644 index 0000000..347d16f --- /dev/null +++ b/DataLabelTemplate/MauiProgram.cs @@ -0,0 +1,27 @@ +using Microsoft.Extensions.Logging; +using Syncfusion.Maui.Core.Hosting; + +namespace DataLabelTemplate +{ + public static class MauiProgram + { + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureSyncfusionCore() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + +#if DEBUG + builder.Logging.AddDebug(); +#endif + + return builder.Build(); + } + } +} diff --git a/DataLabelTemplate/Model.cs b/DataLabelTemplate/Model.cs new file mode 100644 index 0000000..60d8ad3 --- /dev/null +++ b/DataLabelTemplate/Model.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataLabelTemplate +{ + public class Model + { + public string? Department { get; set; } + + public double Value { get; set; } + + public bool IsSummary { get; set; } + } +} diff --git a/DataLabelTemplate/Platforms/Android/AndroidManifest.xml b/DataLabelTemplate/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..bdec9b5 --- /dev/null +++ b/DataLabelTemplate/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DataLabelTemplate/Platforms/Android/MainActivity.cs b/DataLabelTemplate/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..b68e694 --- /dev/null +++ b/DataLabelTemplate/Platforms/Android/MainActivity.cs @@ -0,0 +1,11 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace DataLabelTemplate +{ + [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] + public class MainActivity : MauiAppCompatActivity + { + } +} diff --git a/DataLabelTemplate/Platforms/Android/MainApplication.cs b/DataLabelTemplate/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..6d316be --- /dev/null +++ b/DataLabelTemplate/Platforms/Android/MainApplication.cs @@ -0,0 +1,16 @@ +using Android.App; +using Android.Runtime; + +namespace DataLabelTemplate +{ + [Application] + public class MainApplication : MauiApplication + { + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/DataLabelTemplate/Platforms/Android/Resources/values/colors.xml b/DataLabelTemplate/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..5cd1604 --- /dev/null +++ b/DataLabelTemplate/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/DataLabelTemplate/Platforms/MacCatalyst/AppDelegate.cs b/DataLabelTemplate/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..a389f1c --- /dev/null +++ b/DataLabelTemplate/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace DataLabelTemplate +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/DataLabelTemplate/Platforms/MacCatalyst/Entitlements.plist b/DataLabelTemplate/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..8e87c0c --- /dev/null +++ b/DataLabelTemplate/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/DataLabelTemplate/Platforms/MacCatalyst/Info.plist b/DataLabelTemplate/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..f24aacc --- /dev/null +++ b/DataLabelTemplate/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/DataLabelTemplate/Platforms/MacCatalyst/Program.cs b/DataLabelTemplate/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..f92814b --- /dev/null +++ b/DataLabelTemplate/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace DataLabelTemplate +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/DataLabelTemplate/Platforms/Tizen/Main.cs b/DataLabelTemplate/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..4310018 --- /dev/null +++ b/DataLabelTemplate/Platforms/Tizen/Main.cs @@ -0,0 +1,17 @@ +using Microsoft.Maui; +using Microsoft.Maui.Hosting; +using System; + +namespace DataLabelTemplate +{ + internal class Program : MauiApplication + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } + } +} diff --git a/DataLabelTemplate/Platforms/Tizen/tizen-manifest.xml b/DataLabelTemplate/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..b235385 --- /dev/null +++ b/DataLabelTemplate/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/DataLabelTemplate/Platforms/Windows/App.xaml b/DataLabelTemplate/Platforms/Windows/App.xaml new file mode 100644 index 0000000..cee0ab0 --- /dev/null +++ b/DataLabelTemplate/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/DataLabelTemplate/Platforms/Windows/App.xaml.cs b/DataLabelTemplate/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..6c6f0d9 --- /dev/null +++ b/DataLabelTemplate/Platforms/Windows/App.xaml.cs @@ -0,0 +1,25 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace DataLabelTemplate.WinUI +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : MauiWinUIApplication + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } + +} diff --git a/DataLabelTemplate/Platforms/Windows/Package.appxmanifest b/DataLabelTemplate/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..bd18c18 --- /dev/null +++ b/DataLabelTemplate/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DataLabelTemplate/Platforms/Windows/app.manifest b/DataLabelTemplate/Platforms/Windows/app.manifest new file mode 100644 index 0000000..247807b --- /dev/null +++ b/DataLabelTemplate/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/DataLabelTemplate/Platforms/iOS/AppDelegate.cs b/DataLabelTemplate/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..a389f1c --- /dev/null +++ b/DataLabelTemplate/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace DataLabelTemplate +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/DataLabelTemplate/Platforms/iOS/Info.plist b/DataLabelTemplate/Platforms/iOS/Info.plist new file mode 100644 index 0000000..358337b --- /dev/null +++ b/DataLabelTemplate/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/DataLabelTemplate/Platforms/iOS/Program.cs b/DataLabelTemplate/Platforms/iOS/Program.cs new file mode 100644 index 0000000..f92814b --- /dev/null +++ b/DataLabelTemplate/Platforms/iOS/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace DataLabelTemplate +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/DataLabelTemplate/Properties/launchSettings.json b/DataLabelTemplate/Properties/launchSettings.json new file mode 100644 index 0000000..c16206a --- /dev/null +++ b/DataLabelTemplate/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/DataLabelTemplate/Resources/AppIcon/appicon.svg b/DataLabelTemplate/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..5f04fcf --- /dev/null +++ b/DataLabelTemplate/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DataLabelTemplate/Resources/AppIcon/appiconfg.svg b/DataLabelTemplate/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..62d66d7 --- /dev/null +++ b/DataLabelTemplate/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/DataLabelTemplate/Resources/Fonts/OpenSans-Regular.ttf b/DataLabelTemplate/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..3b69f73 Binary files /dev/null and b/DataLabelTemplate/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/DataLabelTemplate/Resources/Fonts/OpenSans-Semibold.ttf b/DataLabelTemplate/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..0fc5a9a Binary files /dev/null and b/DataLabelTemplate/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/DataLabelTemplate/Resources/Images/dotnet_bot.png b/DataLabelTemplate/Resources/Images/dotnet_bot.png new file mode 100644 index 0000000..f93ce02 Binary files /dev/null and b/DataLabelTemplate/Resources/Images/dotnet_bot.png differ diff --git a/DataLabelTemplate/Resources/Raw/AboutAssets.txt b/DataLabelTemplate/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..50b8a7b --- /dev/null +++ b/DataLabelTemplate/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with you package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/DataLabelTemplate/Resources/Splash/splash.svg b/DataLabelTemplate/Resources/Splash/splash.svg new file mode 100644 index 0000000..62d66d7 --- /dev/null +++ b/DataLabelTemplate/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/DataLabelTemplate/Resources/Styles/Colors.xaml b/DataLabelTemplate/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..22f0a67 --- /dev/null +++ b/DataLabelTemplate/Resources/Styles/Colors.xaml @@ -0,0 +1,45 @@ + + + + + + + #512BD4 + #ac99ea + #242424 + #DFD8F7 + #9880e5 + #2B0B98 + + White + Black + #D600AA + #190649 + #1f1f1f + + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DataLabelTemplate/Resources/Styles/Styles.xaml b/DataLabelTemplate/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..5bc20f1 --- /dev/null +++ b/DataLabelTemplate/Resources/Styles/Styles.xaml @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DataLabelTemplate/ViewModel.cs b/DataLabelTemplate/ViewModel.cs new file mode 100644 index 0000000..37a5cd6 --- /dev/null +++ b/DataLabelTemplate/ViewModel.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataLabelTemplate +{ + public class ChartViewModel + { + public ObservableCollection Data { get; set; } + public ChartViewModel() + { + Data = new ObservableCollection(); + Data.Add(new Model() { Department = "Total", Value = 18000 }); + Data.Add(new Model() { Department = "Production", Value = -2000 }); + Data.Add(new Model() { Department = "Sales", Value = -5000 }); + Data.Add(new Model() { Department = "Investors contribution", Value = 3000 }); + Data.Add(new Model() { Department = "Logistics", Value = -1000 }); + Data.Add(new Model() { Department = "Shares profit", Value = 4000 }); + Data.Add(new Model() { Department = "Marketing", Value = -3000 }); + Data.Add(new Model() { Department = "Transport", Value = -1500 }); + Data.Add(new Model() { Department = "Balance", Value = 0, IsSummary = true }); + + } + } +} diff --git a/README.md b/README.md index f3026cd..2a69739 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,32 @@ -# How-to-add-a-custom-view-to-the-data-label-of-a-.NET-MAUI-Chart -This article demonstrates how to add a customized view to the data label of Syncfusion's MAUI Chart controls. +# How to add a custom view to the data label of a .NET MAUI Chart + +This repository contains a sample project demonstrating how to add a custom view to the data label of a .NET MAUI Chart using Syncfusion controls. + +**Syncfusion Chart Control** + +The [.NET MAUI Charts](https://www.syncfusion.com/maui-controls/maui-cartesian-charts) provides a perfect way to visualize data with a high level of user involvement that focuses on development, productivity, and simplicity of use. Chart also provides a wide variety of charting features that can be used to visualize large quantities of data, as well as flexibility in data binding and user customization. + +**Defining the Custom View** + +Create a DataTemplate for the data label, which typically includes a StackLayout containing a Label to display the value of the data point and an Image to indicate the trend. Customize the appearance of the label and image as needed. + +**Implementing the Value Converter** + +Utilize value converters to dynamically adjust the appearance of the label and image based on the data point's value. For example, you might use a converter to change the text color of the label or to select a specific icon for the image based on the data value. + +**Integrating the Custom View with the Chart** + +Assign the DataTemplate you created to the LabelTemplate property of the series within your chart. Ensure that the ShowDataLabels property is set to True to enable the display of data labels. + +## Output + +![image](https://github.com/SyncfusionExamples/How-to-add-a-custom-view-to-the-data-label-of-a-.NET-MAUI-Chart/assets/113962276/d4f7b597-bc73-4e93-8dc3-9e34d724ff10) + +For a step-by-step procedure, refer to the Knowledge base: [how to add a custom view to the data label of a .NET MAUI Cartesian Chart?](#) + +## Troubleshooting + +**Path too long exception** + +If you are facing a path too long exception when building this example project, close Visual Studio and rename the repository to a shorter name before building the project. +