EZCharts.Maui.Donut 1.0.0-alpha.4

This is a prerelease version of EZCharts.Maui.Donut.
dotnet add package EZCharts.Maui.Donut --version 1.0.0-alpha.4                
NuGet\Install-Package EZCharts.Maui.Donut -Version 1.0.0-alpha.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EZCharts.Maui.Donut" Version="1.0.0-alpha.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EZCharts.Maui.Donut --version 1.0.0-alpha.4                
#r "nuget: EZCharts.Maui.Donut, 1.0.0-alpha.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EZCharts.Maui.Donut as a Cake Addin
#addin nuget:?package=EZCharts.Maui.Donut&version=1.0.0-alpha.4&prerelease

// Install EZCharts.Maui.Donut as a Cake Tool
#tool nuget:?package=EZCharts.Maui.Donut&version=1.0.0-alpha.4&prerelease                

🍩 EZCharts.Maui.Donut

NuGet Version GitHub License GitHub Last Commit

Rendering donut charts in .NET MAUI just got a whole lot easier!

EZCharts.Maui.Donut is a control library built on top of SkiaSharp and inspired by MicroCharts.

The goal is to provide developers with a highly customizable, efficient, and visually appealing donut chart view that they can implement into their applications with minimal setup.

🖼️ Samples

A sample project can be found in the repository where you can dive deeper into setup, customisation and how to use the library in a typical MAUI application. There are samples for MVVM, code behind and XAML setups.

If you want more specific examples or code snippets, check out the examples documentation!

Sample Animation

🔧 Setting Up

  1. Install package via NuGet.

  2. Add UseDonutChart() to your CreateMauiApp() in MauiProgram.cs.

    public static class MauiProgram
    {
        public static MauiApp CreateMauiApp()
        {
            var builder = MauiApp.CreateBuilder();
            builder
                .UseMauiApp<App>()
                .UseDonutChart()
                .ConfigureFonts(fonts =>
                {
                    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                    fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                });
    
            return builder.Build();
        }
    }
    
  3. Add the DonutChartView to your view.

    XAML

    <YourView xmlns:donut="http://schemas.dashthedev.com/ez-charts/maui/donut">
        <donut:DonutChartView />
    </YourView>
    

    Code-Behind

    DonutChartView donutChartView = new();
    Content = donutChartView;
    
  4. Add entry models (your own or our generic class) to display data.

    XAML

    <donut:DonutChartView>
        <x:Array Type="{x:Type donut:DataEntry}">
            <donut:DataEntry Label="English" Value="200" />
            <donut:DataEntry Label="Mathematics" Value="300" />
            <donut:DataEntry Label="Geography" Value="325" />
            <donut:DataEntry Label="Science" Value="50" />
        </x:Array>
    </donut:DonutChartView>
    

    XAML (MVVM)

    <donut:DonutChartView
        EntriesSource="{Binding TestResults}"
        EntryLabelPath="Category"
        EntryValuePath="Score" />
    

    Code-Behind

    donutChartView.EntriesSource = new DataEntry[]
    {
        new()
        {
            Value = 105,
            Label = "Pencils Owned"
        },
        new()
        {
            Value = 234,
            Label = "Pens Owned"
        },
    };
    

    Code-Behind (MVVM)

    IEnumerable<TestResult> testResults = myService.GetTestResults();
    donutChartView.EntriesSource = testResults;
    donutChartView.EntryLabelPath = nameof(TestResult.Category);
    donutChartView.EntryValuePath = nameof(TestResult.Score);
    
  5. Customise to your liking! Options and samples can be found in the documentation.

🤝 Contributing

I work full-time and may not have time to keep things up to date. So if there's something you want to change, then make some contributions! Please read the contribution guide on how to get started.

Any contributions are greatly appreciated. 😄

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios18.0 is compatible.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-alpha.4 78 11/11/2024
1.0.0-alpha.3 85 7/26/2024
1.0.0-alpha.2 67 7/7/2024
1.0.0-alpha.1 53 7/1/2024