This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build the full solution (preferred)
dotnet build Sources/Microcharts.slnx --configuration Release
# Pack all NuGet packages (macOS/Linux)
./buildpackages-maui.sh
# Clean all bin/obj directories
./clean.sh
# Pack individual packages
dotnet pack Sources/Microcharts/Microcharts.csproj --configuration Release
dotnet pack Sources/Microcharts.Maui/Microcharts.Maui.csproj --configuration Release
dotnet pack Sources/Microcharts.Droid/Microcharts.Droid.csproj --configuration Release
dotnet pack Sources/Microcharts.iOS/Microcharts.iOS.csproj --configuration Release
dotnet pack Sources/Microcharts.Metapackage/Microcharts.Metapackage.csproj --configuration ReleaseRequired .NET workloads: android, ios, maccatalyst, maui.
There are no test projects in this repository.
Microcharts is a cross-platform charting library built on SkiaSharp 3.x targeting .NET 10. All chart rendering is platform-agnostic SkiaSharp drawing; platform projects provide thin ChartView wrappers.
Microcharts.Core (net10.0, net10.0-ios, net10.0-android, net10.0-maccatalyst, net10.0-windows)
^ ^ ^
| | |
Maui iOS Droid
(ChartView wrappers - each extends SKCanvasView for its platform)
The Microcharts meta-package aggregates all platform packages via a .nuspec file with target-framework-specific dependency groups.
All charts inherit from Chart (abstract base in Sources/Microcharts/Charts/Chart.cs):
- Chart - Provides
Draw(SKCanvas, width, height), animation, property change notification, and theInvalidatedevent that platform views subscribe to for re-rendering.- SimpleChart - Single-series charts:
PieChart,DonutChart,RadialGaugeChart,HalfRadialGaugeChart,RadarChart - SeriesChart - Multi-series with
ChartSeriecollections- PointChart -
LineChart - AxisBasedChart -
BarChart(handles axis drawing, labels, grid)
- PointChart -
- SimpleChart - Single-series charts:
- Platform
ChartViewsubscribes toChart.Invalidatedvia weak event handler (prevents memory leaks) - On invalidation, view calls platform-specific redraw (
InvalidateSurface()on MAUI,SetNeedsDisplayInRect()on iOS,Invalidate()on Android) Chart.Draw()fills background, then delegates toDrawContent()(abstract, implemented by each chart type)- Charts animate by interpolating
AnimationProgressfrom 0 to 1 overAnimationDuration
ChartEntry- A single data point (Value, Label, ValueLabel, Color)ChartSerie- Named collection of entries with optional color override
Each platform project contains a single ChartView class that extends SKCanvasView and exposes a Chart property. MAUI's version adds BindableProperty for XAML binding. MAUI apps must call UseMicrocharts() on MauiAppBuilder.
Version is managed centrally in Sources/Directory.Build.props (VersionMain property). All package output goes to the /artifacts directory. The publish.yml workflow appends the GitHub run number as a prerelease suffix.
- pull-request.yml - Runs on pull requests (and manual dispatch); builds on
windows-latestandmacos-26(with Xcodelatest-stableviamaxim-lobanov/setup-xcode@v1) - publish.yml - Manual trigger (
workflow_dispatch); always publishes packages to GitHub Packages (microcharts-dotnetorg), and additionally to nuget.org when thepublish_to_nugetinput is set (OIDC trusted publishing)