EZCharts.Maui.Donut 1.0.0-alpha.2

This is a prerelease version of EZCharts.Maui.Donut.
dotnet add package EZCharts.Maui.Donut --version 1.0.0-alpha.2                
NuGet\Install-Package EZCharts.Maui.Donut -Version 1.0.0-alpha.2                
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.2" />                
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.2                
#r "nuget: EZCharts.Maui.Donut, 1.0.0-alpha.2"                
#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.2&prerelease

// Install EZCharts.Maui.Donut as a Cake Tool
#tool nuget:?package=EZCharts.Maui.Donut&version=1.0.0-alpha.2&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.

More detailed samples and documentation coming soon!

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 xmlns namespace and DonutChartView to your XAML view.

    <YourView xmlns:donut="http://schemas.dashthedev.com/ez-charts/maui/donut">
        <donut:DonutChartView />
    </YourView>
    
  4. Add entry models (your own or our generic class) via binding, code-behind or XAML. Your choice!

    Binding
    <donut:DonutChartView
        EntriesSource="{Binding TestResults}"
        EntryLabelPath="Category"
        EntryValuePath="Score" />
    
    Code-behind
    <donut:DonutChartView x:Name="MyChartView" />
    
    public SamplePage()
    {
        InitializeComponent();
    
        MyChartView.EntriesSource = new DataEntry[]
        {
            new()
            {
                Value = 105,
                Label = "Pencils Owned"
            },
            new()
            {
                Value = 234,
                Label = "Pens Owned"
            },
        };
    }
    
    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>
    
  5. Customise to your liking! Options and samples can be found in the documentation (coming soon).

🤝 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-android34.0 is compatible.  net8.0-ios17.2 is compatible.  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.2 40 7/7/2024
1.0.0-alpha.1 41 7/1/2024