{"owner":"Live-Charts","repo":"LiveCharts2","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md",".github/copilot-instructions.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nLiveCharts2 is a cross-platform .NET charting library with a layered architecture:\n- **`src/LiveChartsCore/`** — Platform-agnostic core (math, series, axes, animation). No UI dependencies. Targets `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows`.\n- **`src/skiasharp/LiveChartsCore.SkiaSharp/`** — SkiaSharp rendering backend implementing the core drawing abstractions.\n- **`src/skiasharp/LiveChartsCore.SkiaSharp.{Platform}/`** — Platform-specific view controls (WPF, Avalonia, MAUI, Blazor, WinForms, WinUI, Eto, UNO).\n- **`generators/LiveChartsGenerators/`** — Roslyn source generator for boilerplate reduction.\n\n## Build Commands\n\n```bash\n# Core library (no workloads needed)\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n\n# Platform-specific (examples)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# Platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\ndotnet build LiveCharts.Avalonia.slnx\ndotnet build LiveCharts.Maui.slnx\n\n# Target a specific framework when multi-targeting causes issues\ndotnet build -f net8.0\n```\n\nMAUI/WASM projects require workloads: `dotnet workload install maui --skip-sign-check` / `dotnet workload install wasm-tools --skip-sign-check`. Core and desktop projects (WPF, Avalonia, WinForms) do not.\n\n## Testing\n\n```bash\n# Unit tests (MSTest) — primary test suite\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Snapshot tests (image comparison, net10.0 only)\ndotnet test tests/SnapshotTests/\n\n# UI tests via Factos (requires sample apps built)\ndotnet run --project tests/UITests/\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\n```\n\nTests use `CoreMotionCanvas.IsTesting = true` to disable animations. UI tests are defined in `tests/SharedUITests/` (shared project) and run against each platform via the Factos orchestrator in `tests/UITests/`.\n\n## Running Samples\n\n```bash\ndotnet run --project samples/WPFSample/WPFSample.csproj\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n```\n\nSample ViewModels live in `samples/ViewModelsSamples/` and are shared across all platform samples. Each platform sample creates its own views. `samples/ViewModelsSamples/Index.cs` lists all available sample paths.\n\n## Architecture Details\n\n**Rendering pipeline**: Data → Core series engine (measurement, layout) → SkiaSharp drawables → Platform-native surface. The core is rendering-agnostic — `samples/VorticeSample/` demonstrates using DirectX instead of SkiaSharp.\n\n**Shared projects**: `src/skiasharp/_Shared/`, `_Shared.Xaml/`, `_Shared.WinUI/` contain code shared across platform views via MSBuild linked files (configured in `build/*.Build.props`).\n\n**Code generation**: `LiveChartsGenerators` is a Roslyn analyzer/generator. Controlled by `UseNuGetForGenerator` in `Directory.Build.props` (default: `true` = NuGet package).\n\n**Key build properties** (`Directory.Build.props`):\n- `UseNuGetForSamples`: `false` during development (project references), `true` for CI/release\n- `UITesting`: set to `true` to include shared UI tests in sample projects\n- `GPU`, `VSYNC`, `Diagnose`: rendering mode overrides for testing\n\n## Code Style\n\nBased on [.NET Runtime coding style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) with these exceptions (enforced via `.editorconfig`):\n- `var` is freely used everywhere (not restricted to explicit right-hand types)\n- Single-line `if` without braces is preferred when the line is short; break long lines rather than adding braces\n- Private fields: `_camelCase`, static private: `s_camelCase`, constants: `PascalCase`\n- 4-space indentation, Allman braces, LF line endings\n\n**File naming is critical**: file names must match the class name exactly (`Hello<T>` → `Hello.cs`). Generic and non-generic with the same name go in the same file (only when related by inheritance). This is required for automatic documentation generation.\n\n## Key Constraints\n\n- **Never add platform-specific code to `LiveChartsCore`** — it must remain platform-agnostic\n- **.NET Framework 4.6.2 compatibility must be maintained** (strong-named assemblies, `LiveCharts.snk`)\n- **SkiaSharp version range**: min 2.88.9, latest 3.119.0 — changes must respect both\n- **C# 14.0** language version\n- Animation system (`Motion/`) is core infrastructure — changes require extensive testing\n- Chart updates can arrive from any thread; synchronization is essential\n\n## Additional Documentation\n\nSee `.github/copilot-instructions.md` for extended guidance including: sample platform view patterns (XAML/code-only/Blazor), adding new series types, CI/CD workflow details, and documented build errors with workarounds.\n",".github/copilot-instructions.md":"# LiveCharts2 Copilot Instructions\n\nThis document helps coding agents work efficiently with the LiveCharts2 repository.\n\n## Repository Overview\n\nLiveCharts2 is a flexible, cross-platform charting library for .NET. It follows a layered architecture where:\n- **Core library** (`LiveChartsCore`) is platform-agnostic and handles all chart mathematics\n- **SkiaSharp backend** renders the charts using SkiaSharp\n- **Platform-specific views** provide UI controls for various frameworks (WPF, Avalonia, MAUI, Blazor, etc.)\n\n## Repository Structure\n\n```\nLiveCharts2/\n├── src/\n│   ├── LiveChartsCore/                    # Platform-agnostic core library\n│   │   ├── Kernel/                        # Core charting engine\n│   │   ├── Drawing/                       # Drawing abstractions\n│   │   ├── Motion/                        # Animation system\n│   │   ├── Measure/                       # Chart measurement logic\n│   │   └── [Series types]/                # Line, Bar, Pie, Scatter, etc.\n│   ├── skiasharp/                         # SkiaSharp rendering implementations\n│   │   ├── LiveChartsCore.SkiaSharp/      # Core SkiaSharp provider\n│   │   ├── LiveChartsCore.SkiaSharp.WPF/\n│   │   ├── LiveChartsCore.SkiaSharp.Avalonia/\n│   │   ├── LiveChartsCore.SkiaSharpView.Maui/\n│   │   ├── LiveChartsCore.SkiaSharpView.Blazor/\n│   │   └── [other platforms]/\n│   └── _Shared.Native/                    # Native platform interop\n├── samples/                               # Sample applications\n│   ├── ViewModelsSamples/                 # Shared ViewModels for all samples\n│   │   └── Index.cs                       # List of all sample paths\n│   ├── WPFSample/\n│   ├── AvaloniaSample/\n│   ├── MauiSample/\n│   ├── VorticeSample/                     # DirectX sample (core without SkiaSharp)\n│   └── [other platforms]/\n├── tests/\n│   ├── CoreTests/                         # Core unit tests using MSTest\n│   │   ├── ChartTests/                    # High-level chart tests\n│   │   ├── SeriesTests/                   # Series-specific tests\n│   │   ├── LayoutTests/                   # Layout tests\n│   │   ├── CoreObjectsTests/              # Core objects tests\n│   │   └── OtherTests/                    # Axes, events, etc.\n│   ├── SnapshotTests/                     # Snapshot/image comparison tests (net10.0)\n│   ├── UITests/                           # UI testing orchestrator\n│   │   └── Program.cs                     # Factos-based multi-platform test runner\n│   └── SharedUITests/                     # Shared UI tests (referenced by sample apps)\n│       ├── CartesianChartTests.cs\n│       ├── PieChartTests.cs\n│       ├── PolarChartTests.cs\n│       └── MapChartTests.cs\n├── docs/                                  # Documentation (Scriban templates)\n│   ├── samples/                           # Sample documentation templates\n│   ├── shared/                            # Reusable template fragments\n│   ├── cartesianChart/                    # Cartesian chart docs\n│   ├── piechart/                          # Pie chart docs\n│   └── polarchart/                        # Polar chart docs\n└── generators/                            # Code generators\n```\n\n## Key Architecture Concepts\n\n### 1. Layered Design\n- **LiveChartsCore**: Pure .NET, no UI dependencies, handles all calculations\n- **SkiaSharp Provider**: Implements `IDrawingProvider` to render using SkiaSharp\n- **Platform Views**: WPF/Avalonia/MAUI/etc. specific controls that host the renderer\n\n### 2. Multi-Platform Targeting\n\nCore projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) target:\n- `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows`\n- **No mobile workloads required** to build the core library\n\n**Platform-specific view projects** (WPF, Avalonia, MAUI, etc.) have their own target framework requirements based on the platform.\n\n### 3. Sample Structure\n- **ViewModelsSamples**: Contains shared ViewModels used across all UI frameworks\n- **Index.cs**: Defines available samples as string paths (e.g., \"Lines/Basic\", \"Pies/Doughnut\")\n- Each platform sample project (WPF, Avalonia, etc.) references ViewModelsSamples and creates platform-specific views\n\n### 4. VorticeSample\nA special sample demonstrating how to use LiveChartsCore without SkiaSharp, using DirectX instead. This shows the core library is truly rendering-agnostic.\n\n## Building the Repository\n\n### Prerequisites\n- .NET SDK (see `global.json` for minimum version)\n- No workloads required for core projects\n- Platform-specific projects (MAUI, UNO, Avalonia Browser) require relevant workloads:\n  ```bash\n  dotnet workload install maui\n  dotnet workload install wasm-tools\n  ```\n\n### Build Methods\n\n#### Quick Build - Core Projects\n```bash\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n```\n\n#### Quick Build - Platform Views\n```bash\n# Build specific platform views (recommended for development)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n```\n\n#### Full Build (Windows)\n```bash\n# Build platform-specific projects individually\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj\n# Or use platform-specific solution files (see below)\n```\n\n#### Build with Solution Files\n```bash\n# Use platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\ndotnet build LiveCharts.Avalonia.slnx\ndotnet build LiveCharts.Maui.slnx\n```\n\n### Common Build Issues and Workarounds\n\n#### Issue: Missing workload errors (NETSDK1147)\n```\nerror NETSDK1147: To build this project, the following workloads must be installed: maui\n```\n\n**Context**: This error occurs when building platform-specific view projects (MAUI, UNO, Avalonia Browser) that require specific workloads. Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) do NOT require workloads.\n\n**Workaround Options:**\n1. Install the required workload: `dotnet workload install maui`\n2. Build only the platform you need (e.g., WPF or Avalonia desktop on Windows)\n3. Use platform-specific solution files that don't include all targets\n\n#### Issue: SkiaSharp version conflicts\nThe project supports multiple SkiaSharp versions:\n- `MinSkiaSharpVersion`: 2.88.9 (minimum supported)\n- `LatestSkiaSharpVersion`: 3.119.0 (default for GPU support)\n\nDefined in `Directory.Build.props`.\n\n#### Issue: Multi-targeting complexity\nWhen building fails for specific targets, you can:\n1. Use `-f` to target specific framework: `dotnet build -f net8.0`\n2. Edit `TargetFrameworks` in .csproj to focus on needed platforms\n\n## Testing\n\n### Unit Tests (Core Library)\n\n**Location**: `tests/CoreTests/`\n\n**Framework**: MSTest with coverlet for code coverage\n\n**Run Tests:**\n```bash\ndotnet test tests/CoreTests/\n\n# Run for specific framework\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Run with coverage\ndotnet test tests/CoreTests/ --collect:\"XPlat Code Coverage\"\n```\n\n**Test Structure:**\n- `ChartTests/`: High-level chart functionality\n- `SeriesTests/`: Tests for Line, Bar, Pie, Scatter, Heat, etc.\n- `LayoutTests/`: Stack and table layouts\n- `CoreObjectsTests/`: Transitions, colors, labels\n- `OtherTests/`: Axes, events, data providers, visual elements\n- `MockedObjects/`: Test helpers and mocks\n- `TestsInitializer.cs`: MSTest assembly initialization\n\n**Important**: Tests use `CoreMotionCanvas.IsTesting = true` to disable animations during testing.\n\n### Snapshot Tests\n\n**Location**: `tests/SnapshotTests/`\n\n**Framework**: MSTest, targets `net10.0`\n\nSnapshot tests render charts to images and compare them against stored reference snapshots. They are run in CI on Windows.\n\n**Run Tests:**\n```bash\ndotnet test tests/SnapshotTests/\n```\n\n### UI Testing\n\n**Location**: `tests/UITests/` (orchestrator) and `tests/SharedUITests/` (shared tests)\n\n**Framework**: [Factos](https://github.com/beto-rodriguez/Factos) - A multi-platform UI testing framework\n\n**How it works:**\n1. Shared UI tests are defined in `tests/SharedUITests/` (shared project)\n2. Each sample application references `SharedUITests` \n3. The `tests/UITests/Program.cs` orchestrator:\n   - Starts various sample applications (Avalonia, WPF, MAUI, Blazor, etc.)\n   - Connects to them via Factos\n   - Runs the shared UI tests against each platform\n4. Tests ensure charts render correctly across all supported UI frameworks\n\n**Test Coverage:**\n- `CartesianChartTests.cs`: Cartesian chart rendering and behavior\n- `PieChartTests.cs`: Pie/Doughnut chart tests\n- `PolarChartTests.cs`: Polar chart tests  \n- `MapChartTests.cs`: Map chart tests\n- `AvaloniaTests.cs`: Avalonia-specific tests\n\n**Running UI Tests:**\n```bash\n# Run UI tests (requires sample apps to be built)\ndotnet run --project tests/UITests/\n\n# Run against specific platform (see Program.cs for options)\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\ndotnet run --project tests/UITests/ -- --select maui --test-env \"tf=net10.0-windows10.0.19041.0\"\n```\n\n**Important Notes:**\n- UI testing requires the Factos package\n- Each platform may need specific prerequisites (emulators for mobile, browsers for web)\n- In Debug mode, tests use project references; in Release mode, they use NuGet packages\n- The orchestrator supports testing against multiple target frameworks\n- Mobile platforms (Android, iOS) require running emulators\n\n**Build Configuration for UI Tests:**\nUI test configuration is managed through MSBuild properties. When `UITesting=true` is set, samples include the shared UI test project.\n\n## Running Samples\n\n### Sample Applications\nEach platform has its own sample application that references `ViewModelsSamples`:\n\n```bash\n# Run WPF sample\ndotnet run --project samples/WPFSample/WPFSample.csproj\n\n# Run Avalonia sample\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\n\n# Run Console sample (no UI)\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n```\n\n### Adding New Samples\n1. Add ViewModel class in `samples/ViewModelsSamples/[Category]/[Name].cs`\n2. Add path to `samples/ViewModelsSamples/Index.cs`\n3. Create platform-specific view files in each sample project (WPF, Avalonia, etc.)\n\n### Sample Platforms Reference\n\nThe following platforms each need a view for every sample. **ConsoleSample** and **VorticeSample** are excluded — they don't follow this pattern.\n\n| Platform | Root path | View file(s) | Base class | LVC namespace (xmlns:lvc) |\n|---|---|---|---|---|\n| **Avalonia** | `samples/AvaloniaSample/[Category]/[Name]/` | `View.axaml` + `View.axaml.cs` | `UserControl` | `using:LiveChartsCore.SkiaSharpView.Avalonia` |\n| **WPF** | `samples/WPFSample/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `UserControl` | `clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF` |\n| **MAUI** | `samples/MauiSample/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `ContentPage` | `clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui` |\n| **WinUI** | `samples/WinUISample/WinUISample/Samples/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `UserControl` (`sealed partial`) | `using:LiveChartsCore.SkiaSharpView.WinUI` |\n| **WinForms** | `samples/WinFormsSample/[Category]/[Name]/` | `View.cs` + `View.Designer.cs` + `View.resx` | `UserControl` (`partial`) | N/A — code-only |\n| **Blazor** | `samples/BlazorSample/Pages/[Category]/[Name]/` | `View.razor` | N/A — Razor component | `@using LiveChartsCore.SkiaSharpView.Blazor` |\n| **EtoForms** | `samples/EtoFormsSample/[Category]/[Name]/` | `View.cs` | `Panel` (non-partial) | N/A — code-only |\n| **UnoPlatform** | *(no separate files)* | Reuses `WinUISample` views via reflection | — | — |\n\n**Key facts for each platform:**\n\n- **All XAML platforms (Avalonia, WPF, MAUI, WinUI)** use `Activator.CreateInstance` with the pattern `{Platform}.{Category}.{Name}.View` to load views — so the **C# namespace must exactly match** `{PlatformPrefix}.{Category}.{Name}` and the class must be named `View`.\n- **WinForms** and **EtoForms** use the same reflection pattern. The view class must be `partial class View : UserControl` (WinForms) or `class View : Panel` (EtoForms).\n- **Blazor** uses Razor's `@page \"/{Category}/{Name}\"` directive for routing. The nav menu reads `ViewModelsSamples.Index.Samples` automatically.\n- **UnoPlatform** (`samples/UnoPlatformSample/`) loads views from the `WinUISample` assembly — no separate files are needed.\n\n**XAML DataContext / BindingContext patterns:**\n\n```xml\n<!-- Avalonia (View.axaml) -->\n<UserControl xmlns:lvc=\"using:LiveChartsCore.SkiaSharpView.Avalonia\"\n             xmlns:vms=\"using:ViewModelsSamples.[Category].[Name]\"\n             x:DataType=\"vms:ViewModel\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n\n<!-- WPF (View.xaml) -->\n<UserControl xmlns:lvc=\"clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF\"\n             xmlns:vms=\"clr-namespace:ViewModelsSamples.[Category].[Name];assembly=ViewModelsSamples\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n\n<!-- MAUI (View.xaml) — ContentPage + XamlCompilation attribute on code-behind -->\n<ContentPage xmlns:lvc=\"clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui\"\n             xmlns:vms=\"clr-namespace:ViewModelsSamples.[Category].[Name];assembly=ViewModelsSamples\"\n             x:DataType=\"vms:ViewModel\">\n    <ContentPage.BindingContext><vms:ViewModel/></ContentPage.BindingContext>\n</ContentPage>\n\n<!-- WinUI (View.xaml) — sealed partial class -->\n<UserControl xmlns:lvc=\"using:LiveChartsCore.SkiaSharpView.WinUI\"\n             xmlns:vms=\"using:ViewModelsSamples.[Category].[Name]\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n```\n\n**Code-only platforms (WinForms / EtoForms)** typically instantiate the ViewModel directly or inline the data:\n\n```csharp\n// WinForms — partial class View : UserControl\nvar vm = new ViewModel();\nvar chart = new GeoMap { Series = vm.Series, ... };\nchart.Location = new System.Drawing.Point(0, 0);\nchart.Size = new System.Drawing.Size(50, 50);\nchart.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;\nControls.Add(chart);\n\n// EtoForms — class View : Panel (non-partial, no Designer file)\nvar vm = new ViewModel();\nvar chart = new GeoMap { Series = vm.Series, ... };\nContent = new DynamicLayout(chart);\n```\n\n**WinForms `View.Designer.cs`** is always a minimal boilerplate — copy from any existing sample, just update the namespace.\n\n**UI-testing accessor** — most XAML views expose a `Chart` property under `#if UI_TESTING` for the Factos test runner:\n\n```csharp\n// XAML platforms (WPF, Avalonia, MAUI, WinUI)\n#if UI_TESTING\n    public SomeChartType Chart => chartNamedInXaml;\n#endif\n\n// EtoForms / WinForms\npublic SomeChartType Chart;  // public field, always present\n```\n\n**Blazor** exposes the chart via `@ref`:\n```razor\n<CartesianChart @ref=\"Chart\" .../>\n@code { public CartesianChart Chart; }\n```\n\n## Code Style and Conventions\n\n### Editor Config\nThe repository uses `.editorconfig` based on [.NET Runtime coding style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) with exceptions.\n\n**Key Style Rules:**\n- **Indentation**: 4 spaces\n- **Line endings**: LF, insert final newline\n- **Braces**: New line before open brace (Allman style)\n- **var usage**: Use `var` freely (explicitly allowed)\n- **Single-line if**: Allowed and preferred when line is short\n- **Naming**:\n  - Private/internal fields: `_camelCase`\n  - Static private fields: `s_camelCase`\n  - Constants: `PascalCase`\n- **Using directives**: Outside namespace\n\n### File Naming\n**Critical for auto-generated documentation:**\n- File names MUST match the class name exactly\n- `public class Hello` → `Hello.cs`\n- `public class Hello<T>` → `Hello.cs` (ignore generics)\n- Generic and non-generic with same name → same file (only if inheritance relationship)\n\n### Important Constants\nDefined in `Directory.Build.props`:\n- `LiveChartsVersion`: Current version (2.0.0-rc6.1)\n- `MinSkiaSharpVersion`: 2.88.9\n- `LatestSkiaSharpVersion`: 3.119.0\n- `LangVersion`: 14.0 (C# 14)\n\n## Build Configuration Properties\n\n### Rendering Settings\nRendering settings are configured via MSBuild properties:\n- `GPU`: Enable/disable GPU acceleration\n- `VSYNC`: Enable/disable vertical sync\n- `FPS`: Frame rate (10, 20, 30, 45, 60, 75, 90, 120)\n- `Diagnose`: Enable diagnostic mode\n\nThese create conditional compilation symbols for testing different rendering modes.\n\n### Development Flags\nIn `Directory.Build.props`:\n- `UseNuGetForSamples`: Use NuGet packages vs project references (default: false)\n- `UseNuGetForGenerator`: Use NuGet generator package (default: true)\n\n## CI/CD\n\n### GitHub Actions Workflows\n\n#### 1. Main CI (`livecharts.yml`)\n- Triggers: Pull requests\n- Runs on: `windows-2025` (pack/test), `ubuntu-24.04` (Linux/browser), `macos-26` (Mac/iOS)\n- Steps:\n  1. **Pack**: Builds NuGet packages for all platform libraries (core, skiasharp, WPF, Avalonia, MAUI, Blazor, WinUI, UNO, WinForms, Eto)\n  2. **test-core**: Runs `CoreTests` on `net8.0` and `net462`\n  3. **test-snapshot**: Runs `SnapshotTests`\n  4. **test-windows/linux/mac/browser/android/ios**: Runs Factos UI tests for each platform\n- On tag pushes (after tests pass): publishes packages to NuGet.org\n\n#### 2. Publish (`publish.yml`)\n- Handles NuGet package publishing\n\n**Note**: The CI uses NuGet packages (not project references) when running UI tests in Release mode.\n\n## Common Development Workflows\n\n### Adding a New Series Type\n1. Create series class in `src/LiveChartsCore/[SeriesType]/`\n2. Implement series interfaces (`ISeries`, etc.)\n3. Create SkiaSharp drawable in `src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/`\n4. Add tests in `tests/CoreTests/SeriesTests/`\n5. Create sample ViewModel in `samples/ViewModelsSamples/`\n6. Update `samples/ViewModelsSamples/Index.cs`\n\n### Adding Platform Support\n1. Create new project in `src/skiasharp/LiveChartsCore.SkiaSharpView.[Platform]/`\n2. Reference `LiveChartsCore.SkiaSharp` project\n3. Create platform-specific control classes\n4. Add shared code to `_Shared/` if applicable\n5. Create sample application in `samples/[Platform]Sample/`\n6. Add platform-specific solution file\n\n### Updating Documentation\n\n**Important**: Documentation files in the `docs/` folder are **Scriban templates**, not final markdown files.\n\n**How it works:**\n1. Template files are compiled by an external (non-open-source) repository\n2. Templates use [Scriban](https://github.com/scriban/scriban) - a fast, powerful, and lightweight text templating language\n3. Scriban supports custom functions and expressions embedded in the markdown\n\n**Common Scriban expressions you'll find:**\n\n**File inclusion** - Renders content from source files:\n```\n{{~ render \"~/../samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs\" ~}}\n{{~ render \"~/../samples/MauiSample/MauiProgram.cs\" ~}}\n{{~ render \"~/../samples/{samples_folder}/Events/Cartesian{view_extension}\" ~}}\n```\n\n**Conditionals** - Platform-specific content:\n```\n{{~ if xaml ~}}\n  Content for XAML platforms (WPF, Avalonia, UNO, WinUI, MAUI)\n{{~ end ~}}\n\n{{~ if winforms ~}}\n  Content specific to WinForms\n{{~ end ~}}\n```\n\n**Variables** - Dynamic content:\n```\n{{ website_url }}/docs/{{ platform }}/{{ version }}/About\n{{ assets_url }}/docs/{{ unique_name }}/result.gif\n{{ name | to_title_case }}\n{{ edit_source | replace_local_to_server }}\n```\n\n**Loops** - Iterate over collections:\n```\n{{~ for r in related_to ~}}\n  <a href=\"{{ compile this r.url }}\">{{ r.name }}</a>\n{{~ end ~}}\n```\n\n**Template structure:**\n- `docs/samples/[category]/[name]/template.md` - Sample documentation templates\n- `docs/shared/*.md` - Reusable template fragments included via `{{ render \"~/shared/...\" }}`\n- `docs/piechart/`, `docs/cartesianChart/`, etc. - Feature documentation with templates\n\n**When editing docs:**\n- Always edit the `.md` files as Scriban templates\n- Test template syntax (though final compilation happens externally)\n- Use `{{~ ~}}` syntax to strip whitespace around expressions\n- File paths in `render` are relative to the template location (use `~/../` for repo root)\n\n## Important Notes for Coding Agents\n\n### Do's\n- ✅ Use project references during development (not NuGet packages)\n- ✅ Follow the exact file naming convention (critical for docs)\n- ✅ Run tests after changes to core or series logic\n- ✅ Use platform-specific solution files for focused development\n- ✅ Consult `CONTRIBUTING.md` for detailed style guide\n- ✅ Use shared code in `_Shared/` folders when adding cross-platform features\n\n### Don'ts\n- ❌ Don't break multi-platform support when modifying core projects\n- ❌ Don't add platform-specific code to `LiveChartsCore` (keep it agnostic)\n- ❌ Don't ignore `.editorconfig` warnings\n- ❌ Don't remove or modify working tests without good reason\n- ❌ Don't add new dependencies without checking compatibility across all target frameworks\n\n### Special Considerations\n- The library supports .NET Framework 4.6.2 - maintain compatibility\n- SkiaSharp is abstracted - core library should work with other rendering engines\n- Animation system (`Motion/`) is critical - changes require extensive testing\n- Multi-threading: Chart updates can come from any thread; proper synchronization is essential\n\n## Quick Reference Commands\n\n```bash\n# === Building ===\n# Build core library (no workloads needed)\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n\n# Build platform-specific projects\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# === Install Workloads (for platform-specific projects) ===\ndotnet workload install maui --skip-sign-check\ndotnet workload install wasm-tools --skip-sign-check\n\n# Check installed workloads\ndotnet workload list\n\n# === Testing ===\n# Run core unit tests\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Run snapshot tests\ndotnet test tests/SnapshotTests/\n\n# Run UI tests (requires sample apps to build)\ndotnet run --project tests/UITests/\n\n# Run UI tests for specific platform\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\n\n# === Running Samples ===\n# Run WPF sample\ndotnet run --project samples/WPFSample/WPFSample.csproj\n\n# Run Avalonia sample\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\n\n# Run Console sample (no UI)\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n\n# === Troubleshooting ===\n# Clean build artifacts\ndotnet clean\nfind . -type d -name \"bin\" -o -name \"obj\" | xargs rm -rf\n\n# Restore packages\ndotnet restore\n\n# Check for workload issues\ndotnet workload restore --skip-sign-check\n```\n\n## Documented Errors and Workarounds\n\nThis section documents actual errors encountered when working with this repository and their solutions.\n\n### Error 1: NETSDK1147 - Missing Workloads\n\n**Error Message:**\n```\nerror NETSDK1147: To build this project, the following workloads must be installed: maui\nTo install these workloads, run the following command: dotnet workload restore\n```\n\n**Context**: This occurs when building platform-specific view projects (MAUI, UNO, Avalonia Browser) that require specific workloads. Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) do NOT require any workloads.\n\n**Workarounds:**\n\n**Option 1: Install Required Workloads**\n```bash\ndotnet workload install maui --skip-sign-check\ndotnet workload install wasm-tools --skip-sign-check\n```\n\n**Option 2: Build Platform-Specific Projects that don't need workloads**\n```bash\n# Build only WPF (Windows only)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\n\n# Build only Avalonia desktop (cross-platform)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# Use platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\n```\n\n### Error 2: Visual Studio Component Required\n\n**Error Message:**\n```\nUnhandled exception: The imported file \"$(MSBuildExtensionsPath32)/Microsoft/VisualStudio/v$(VisualStudioVersion)/CodeSharing/Microsoft.CodeSharing.Common.Default.props\" does not exist and appears to be part of a Visual Studio component.\n```\n\n**Context**: Appears when running `dotnet workload restore` on non-Windows systems or when Visual Studio is not installed.\n\n**Why it happens**: The `src/skiasharp/_Shared.WinUI/_Shared.WinUI.shproj` shared project requires Visual Studio components that are Windows-specific.\n\n**Workaround**: This error can be ignored if you're not building WinUI projects. The workload installation succeeds despite this error. If you need to build WinUI:\n- Use Windows with Visual Studio 2022 installed\n- Use `msbuild` instead of `dotnet build` for WinUI projects\n\n### Error 3: Ambiguous Argument with Git\n\n**Error Message:**\n```\nfatal: ambiguous argument 'origin/branch-name': unknown revision or path not in the working tree.\n```\n\n**Context**: After fetching a branch with `git fetch origin branch-name`, trying to reference it as `origin/branch-name`.\n\n**Why it happens**: Git fetch stores the ref as `FETCH_HEAD`, not as a trackable remote branch.\n\n**Solution**: Use `FETCH_HEAD` or create a local tracking branch:\n```bash\n# Option 1: Use FETCH_HEAD directly\ngit log FETCH_HEAD\n\n# Option 2: Create tracking branch\ngit fetch origin main\ngit checkout -b main --track origin/main\n\n# Option 3: Fetch with branch creation\ngit fetch origin main:main\n```\n\n### Error 4: Package Not Found During Build\n\n**Context**: Sample applications may fail to build if NuGet packages are not found.\n\n**Why it happens**: `UseNuGetForSamples` flag in `Directory.Build.props` controls whether samples use project references or NuGet packages.\n\n**Solution**: Ensure you're using project references during development:\n```xml\n<!-- In Directory.Build.props -->\n<UseNuGetForSamples>false</UseNuGetForSamples>\n```\n\nOr restore NuGet packages if building from packages:\n```bash\ndotnet restore\n```\n\n### Error 5: Strong Name Assembly Conflicts\n\n**Context**: When building for .NET Framework 4.6.2, you may encounter assembly version conflicts.\n\n**Why it happens**: .NET Framework uses strong-named assemblies, and SkiaSharp has different versioning.\n\n**Referenced Issue**: https://github.com/mono/SkiaSharp/issues/3153\n\n**Solution**: The project is configured to handle this, but if you encounter issues:\n1. Clean the solution: `dotnet clean`\n2. Delete `bin` and `obj` folders\n3. Restore and rebuild: `dotnet restore && dotnet build`\n\n### Error 6: Test Build Failures on CI\n\n**Context**: UI tests may fail with target framework mismatches in CI.\n\n**Solution**: The UI test infrastructure uses special MSBuild properties:\n- `TestBuildTargetFramework`: Override target framework for test builds\n- `IsTestBuild`: Flag to indicate test build\n- `UITesting`: Flag to include shared UI tests\n\nExample from `tests/UITests/Program.cs`:\n```csharp\nMSBuildArg tf_n10w = new(\"TestBuildTargetFramework\", \"net10.0-windows\");\nMSBuildArg isTest = new(\"IsTestBuild\", \"true\");\n```\n\n## Troubleshooting\n\n### Problem: Can't build platform-specific projects - workload errors\n**Solution**: Install the required workload for the platform you're targeting (e.g., `dotnet workload install maui`). Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) build without any workloads.\n\n### Problem: SkiaSharp errors\n**Solution**: Check SkiaSharp version in `Directory.Build.props`, ensure NuGet restore succeeded\n\n### Problem: Tests fail with animation issues\n**Solution**: Verify `CoreMotionCanvas.IsTesting = true` in test initialization\n\n### Problem: Sample won't run\n**Solution**: Ensure platform-specific dependencies are installed (e.g., .NET Desktop Runtime for WPF)\n\n### Problem: Generator errors\n**Solution**: Check `UseNuGetForGenerator` setting and ensure LiveChartsGenerators package/project is available\n\n## Issue Reproduction & Fix Workflow\n\nWhen picking up a GitHub issue (reproduce → diagnose → fix → regression test → PR),\nfollow the canonical workflow at [`.claude/skills/repro-and-fix/SKILL.md`](../.claude/skills/repro-and-fix/SKILL.md).\nThat doc is the single source of truth for both Claude Code and Copilot Coding Agent —\nkeep edits there, not duplicated here.\n\nQuick reference for the dev-loop hooks the workflow relies on:\n\n- **`LVC_SAMPLE=<sample-path>`** — XAML samples (Avalonia / WPF / WinUI / MAUI / Uno) auto-navigate to the named sample on launch, e.g. `LVC_SAMPLE=VisualTest/Issue1986Repro`. Skips manual UI navigation for repros.\n- **`LVC_SCREENSHOT=<png-path>`** — Avalonia / WPF / WinUI samples render the main window to PNG via `RenderTargetBitmap` shortly after activation and exit. Captures scale to physical pixels on HiDPI.\n- **`LVC_SCREENSHOT_DELAY_MS=<ms>`** — overrides the 3 s default settle delay before the in-app screenshot is taken (use on slower CI hosts).\n- **`.claude/scripts/capture-window.{ps1,-macos.sh,-linux.sh}`** — per-OS PrintWindow / `screencapture` / `grim` fallbacks for platforms without an in-app capture path (MAUI, Uno).\n\nRepro views live under `samples/AvaloniaSample/VisualTest/Issue<N>Repro/` (or\nthe equivalent under whichever platform sample fits the bug). Their code-behind\nexposes helpers (e.g. `FindTemplatedGaugeSeries()`) that Factos UI tests call\ndirectly. Factos and `LVC_SAMPLE` navigate by path and don't need the repro\nregistered in `samples/ViewModelsSamples/Index.cs` — **do not commit changes\nto that file for a repro view.** It's shared across every platform sample,\nso a single-platform repro entry will crash the load on the other platforms.\n\n## Resources\n\n- **Main Documentation**: https://livecharts.dev\n- **Contributing Guide**: `CONTRIBUTING.md`\n- **Repository**: https://github.com/Live-Charts/LiveCharts2\n- **Code of Conduct**: `CODE_OF_CONDUCT.md`\n- **License**: MIT (see `LICENSE`)\n\n## Version Information\n\n- **Current Version**: 2.0.0-rc6.1 (Release Candidate)\n- **C# Language Version**: 14.0\n- **SkiaSharp**: 2.88.9 (min) to 3.119.0 (latest)\n- **Target Frameworks**: `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows` (core); plus platform-specific targets for view projects\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nLiveCharts2 is a cross-platform .NET charting library with a layered architecture:\n- **`src/LiveChartsCore/`** — Platform-agnostic core (math, series, axes, animation). No UI dependencies. Targets `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows`.\n- **`src/skiasharp/LiveChartsCore.SkiaSharp/`** — SkiaSharp rendering backend implementing the core drawing abstractions.\n- **`src/skiasharp/LiveChartsCore.SkiaSharp.{Platform}/`** — Platform-specific view controls (WPF, Avalonia, MAUI, Blazor, WinForms, WinUI, Eto, UNO).\n- **`generators/LiveChartsGenerators/`** — Roslyn source generator for boilerplate reduction.\n\n## Build Commands\n\n```bash\n# Core library (no workloads needed)\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n\n# Platform-specific (examples)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# Platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\ndotnet build LiveCharts.Avalonia.slnx\ndotnet build LiveCharts.Maui.slnx\n\n# Target a specific framework when multi-targeting causes issues\ndotnet build -f net8.0\n```\n\nMAUI/WASM projects require workloads: `dotnet workload install maui --skip-sign-check` / `dotnet workload install wasm-tools --skip-sign-check`. Core and desktop projects (WPF, Avalonia, WinForms) do not.\n\n## Testing\n\n```bash\n# Unit tests (MSTest) — primary test suite\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Snapshot tests (image comparison, net10.0 only)\ndotnet test tests/SnapshotTests/\n\n# UI tests via Factos (requires sample apps built)\ndotnet run --project tests/UITests/\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\n```\n\nTests use `CoreMotionCanvas.IsTesting = true` to disable animations. UI tests are defined in `tests/SharedUITests/` (shared project) and run against each platform via the Factos orchestrator in `tests/UITests/`.\n\n## Running Samples\n\n```bash\ndotnet run --project samples/WPFSample/WPFSample.csproj\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n```\n\nSample ViewModels live in `samples/ViewModelsSamples/` and are shared across all platform samples. Each platform sample creates its own views. `samples/ViewModelsSamples/Index.cs` lists all available sample paths.\n\n## Architecture Details\n\n**Rendering pipeline**: Data → Core series engine (measurement, layout) → SkiaSharp drawables → Platform-native surface. The core is rendering-agnostic — `samples/VorticeSample/` demonstrates using DirectX instead of SkiaSharp.\n\n**Shared projects**: `src/skiasharp/_Shared/`, `_Shared.Xaml/`, `_Shared.WinUI/` contain code shared across platform views via MSBuild linked files (configured in `build/*.Build.props`).\n\n**Code generation**: `LiveChartsGenerators` is a Roslyn analyzer/generator. Controlled by `UseNuGetForGenerator` in `Directory.Build.props` (default: `true` = NuGet package).\n\n**Key build properties** (`Directory.Build.props`):\n- `UseNuGetForSamples`: `false` during development (project references), `true` for CI/release\n- `UITesting`: set to `true` to include shared UI tests in sample projects\n- `GPU`, `VSYNC`, `Diagnose`: rendering mode overrides for testing\n\n## Code Style\n\nBased on [.NET Runtime coding style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) with these exceptions (enforced via `.editorconfig`):\n- `var` is freely used everywhere (not restricted to explicit right-hand types)\n- Single-line `if` without braces is preferred when the line is short; break long lines rather than adding braces\n- Private fields: `_camelCase`, static private: `s_camelCase`, constants: `PascalCase`\n- 4-space indentation, Allman braces, LF line endings\n\n**File naming is critical**: file names must match the class name exactly (`Hello<T>` → `Hello.cs`). Generic and non-generic with the same name go in the same file (only when related by inheritance). This is required for automatic documentation generation.\n\n## Key Constraints\n\n- **Never add platform-specific code to `LiveChartsCore`** — it must remain platform-agnostic\n- **.NET Framework 4.6.2 compatibility must be maintained** (strong-named assemblies, `LiveCharts.snk`)\n- **SkiaSharp version range**: min 2.88.9, latest 3.119.0 — changes must respect both\n- **C# 14.0** language version\n- Animation system (`Motion/`) is core infrastructure — changes require extensive testing\n- Chart updates can arrive from any thread; synchronization is essential\n\n## Additional Documentation\n\nSee `.github/copilot-instructions.md` for extended guidance including: sample platform view patterns (XAML/code-only/Blazor), adding new series types, CI/CD workflow details, and documented build errors with workarounds.\n",".github/copilot-instructions.md":"# LiveCharts2 Copilot Instructions\n\nThis document helps coding agents work efficiently with the LiveCharts2 repository.\n\n## Repository Overview\n\nLiveCharts2 is a flexible, cross-platform charting library for .NET. It follows a layered architecture where:\n- **Core library** (`LiveChartsCore`) is platform-agnostic and handles all chart mathematics\n- **SkiaSharp backend** renders the charts using SkiaSharp\n- **Platform-specific views** provide UI controls for various frameworks (WPF, Avalonia, MAUI, Blazor, etc.)\n\n## Repository Structure\n\n```\nLiveCharts2/\n├── src/\n│   ├── LiveChartsCore/                    # Platform-agnostic core library\n│   │   ├── Kernel/                        # Core charting engine\n│   │   ├── Drawing/                       # Drawing abstractions\n│   │   ├── Motion/                        # Animation system\n│   │   ├── Measure/                       # Chart measurement logic\n│   │   └── [Series types]/                # Line, Bar, Pie, Scatter, etc.\n│   ├── skiasharp/                         # SkiaSharp rendering implementations\n│   │   ├── LiveChartsCore.SkiaSharp/      # Core SkiaSharp provider\n│   │   ├── LiveChartsCore.SkiaSharp.WPF/\n│   │   ├── LiveChartsCore.SkiaSharp.Avalonia/\n│   │   ├── LiveChartsCore.SkiaSharpView.Maui/\n│   │   ├── LiveChartsCore.SkiaSharpView.Blazor/\n│   │   └── [other platforms]/\n│   └── _Shared.Native/                    # Native platform interop\n├── samples/                               # Sample applications\n│   ├── ViewModelsSamples/                 # Shared ViewModels for all samples\n│   │   └── Index.cs                       # List of all sample paths\n│   ├── WPFSample/\n│   ├── AvaloniaSample/\n│   ├── MauiSample/\n│   ├── VorticeSample/                     # DirectX sample (core without SkiaSharp)\n│   └── [other platforms]/\n├── tests/\n│   ├── CoreTests/                         # Core unit tests using MSTest\n│   │   ├── ChartTests/                    # High-level chart tests\n│   │   ├── SeriesTests/                   # Series-specific tests\n│   │   ├── LayoutTests/                   # Layout tests\n│   │   ├── CoreObjectsTests/              # Core objects tests\n│   │   └── OtherTests/                    # Axes, events, etc.\n│   ├── SnapshotTests/                     # Snapshot/image comparison tests (net10.0)\n│   ├── UITests/                           # UI testing orchestrator\n│   │   └── Program.cs                     # Factos-based multi-platform test runner\n│   └── SharedUITests/                     # Shared UI tests (referenced by sample apps)\n│       ├── CartesianChartTests.cs\n│       ├── PieChartTests.cs\n│       ├── PolarChartTests.cs\n│       └── MapChartTests.cs\n├── docs/                                  # Documentation (Scriban templates)\n│   ├── samples/                           # Sample documentation templates\n│   ├── shared/                            # Reusable template fragments\n│   ├── cartesianChart/                    # Cartesian chart docs\n│   ├── piechart/                          # Pie chart docs\n│   └── polarchart/                        # Polar chart docs\n└── generators/                            # Code generators\n```\n\n## Key Architecture Concepts\n\n### 1. Layered Design\n- **LiveChartsCore**: Pure .NET, no UI dependencies, handles all calculations\n- **SkiaSharp Provider**: Implements `IDrawingProvider` to render using SkiaSharp\n- **Platform Views**: WPF/Avalonia/MAUI/etc. specific controls that host the renderer\n\n### 2. Multi-Platform Targeting\n\nCore projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) target:\n- `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows`\n- **No mobile workloads required** to build the core library\n\n**Platform-specific view projects** (WPF, Avalonia, MAUI, etc.) have their own target framework requirements based on the platform.\n\n### 3. Sample Structure\n- **ViewModelsSamples**: Contains shared ViewModels used across all UI frameworks\n- **Index.cs**: Defines available samples as string paths (e.g., \"Lines/Basic\", \"Pies/Doughnut\")\n- Each platform sample project (WPF, Avalonia, etc.) references ViewModelsSamples and creates platform-specific views\n\n### 4. VorticeSample\nA special sample demonstrating how to use LiveChartsCore without SkiaSharp, using DirectX instead. This shows the core library is truly rendering-agnostic.\n\n## Building the Repository\n\n### Prerequisites\n- .NET SDK (see `global.json` for minimum version)\n- No workloads required for core projects\n- Platform-specific projects (MAUI, UNO, Avalonia Browser) require relevant workloads:\n  ```bash\n  dotnet workload install maui\n  dotnet workload install wasm-tools\n  ```\n\n### Build Methods\n\n#### Quick Build - Core Projects\n```bash\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n```\n\n#### Quick Build - Platform Views\n```bash\n# Build specific platform views (recommended for development)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n```\n\n#### Full Build (Windows)\n```bash\n# Build platform-specific projects individually\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj\n# Or use platform-specific solution files (see below)\n```\n\n#### Build with Solution Files\n```bash\n# Use platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\ndotnet build LiveCharts.Avalonia.slnx\ndotnet build LiveCharts.Maui.slnx\n```\n\n### Common Build Issues and Workarounds\n\n#### Issue: Missing workload errors (NETSDK1147)\n```\nerror NETSDK1147: To build this project, the following workloads must be installed: maui\n```\n\n**Context**: This error occurs when building platform-specific view projects (MAUI, UNO, Avalonia Browser) that require specific workloads. Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) do NOT require workloads.\n\n**Workaround Options:**\n1. Install the required workload: `dotnet workload install maui`\n2. Build only the platform you need (e.g., WPF or Avalonia desktop on Windows)\n3. Use platform-specific solution files that don't include all targets\n\n#### Issue: SkiaSharp version conflicts\nThe project supports multiple SkiaSharp versions:\n- `MinSkiaSharpVersion`: 2.88.9 (minimum supported)\n- `LatestSkiaSharpVersion`: 3.119.0 (default for GPU support)\n\nDefined in `Directory.Build.props`.\n\n#### Issue: Multi-targeting complexity\nWhen building fails for specific targets, you can:\n1. Use `-f` to target specific framework: `dotnet build -f net8.0`\n2. Edit `TargetFrameworks` in .csproj to focus on needed platforms\n\n## Testing\n\n### Unit Tests (Core Library)\n\n**Location**: `tests/CoreTests/`\n\n**Framework**: MSTest with coverlet for code coverage\n\n**Run Tests:**\n```bash\ndotnet test tests/CoreTests/\n\n# Run for specific framework\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Run with coverage\ndotnet test tests/CoreTests/ --collect:\"XPlat Code Coverage\"\n```\n\n**Test Structure:**\n- `ChartTests/`: High-level chart functionality\n- `SeriesTests/`: Tests for Line, Bar, Pie, Scatter, Heat, etc.\n- `LayoutTests/`: Stack and table layouts\n- `CoreObjectsTests/`: Transitions, colors, labels\n- `OtherTests/`: Axes, events, data providers, visual elements\n- `MockedObjects/`: Test helpers and mocks\n- `TestsInitializer.cs`: MSTest assembly initialization\n\n**Important**: Tests use `CoreMotionCanvas.IsTesting = true` to disable animations during testing.\n\n### Snapshot Tests\n\n**Location**: `tests/SnapshotTests/`\n\n**Framework**: MSTest, targets `net10.0`\n\nSnapshot tests render charts to images and compare them against stored reference snapshots. They are run in CI on Windows.\n\n**Run Tests:**\n```bash\ndotnet test tests/SnapshotTests/\n```\n\n### UI Testing\n\n**Location**: `tests/UITests/` (orchestrator) and `tests/SharedUITests/` (shared tests)\n\n**Framework**: [Factos](https://github.com/beto-rodriguez/Factos) - A multi-platform UI testing framework\n\n**How it works:**\n1. Shared UI tests are defined in `tests/SharedUITests/` (shared project)\n2. Each sample application references `SharedUITests` \n3. The `tests/UITests/Program.cs` orchestrator:\n   - Starts various sample applications (Avalonia, WPF, MAUI, Blazor, etc.)\n   - Connects to them via Factos\n   - Runs the shared UI tests against each platform\n4. Tests ensure charts render correctly across all supported UI frameworks\n\n**Test Coverage:**\n- `CartesianChartTests.cs`: Cartesian chart rendering and behavior\n- `PieChartTests.cs`: Pie/Doughnut chart tests\n- `PolarChartTests.cs`: Polar chart tests  \n- `MapChartTests.cs`: Map chart tests\n- `AvaloniaTests.cs`: Avalonia-specific tests\n\n**Running UI Tests:**\n```bash\n# Run UI tests (requires sample apps to be built)\ndotnet run --project tests/UITests/\n\n# Run against specific platform (see Program.cs for options)\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\ndotnet run --project tests/UITests/ -- --select maui --test-env \"tf=net10.0-windows10.0.19041.0\"\n```\n\n**Important Notes:**\n- UI testing requires the Factos package\n- Each platform may need specific prerequisites (emulators for mobile, browsers for web)\n- In Debug mode, tests use project references; in Release mode, they use NuGet packages\n- The orchestrator supports testing against multiple target frameworks\n- Mobile platforms (Android, iOS) require running emulators\n\n**Build Configuration for UI Tests:**\nUI test configuration is managed through MSBuild properties. When `UITesting=true` is set, samples include the shared UI test project.\n\n## Running Samples\n\n### Sample Applications\nEach platform has its own sample application that references `ViewModelsSamples`:\n\n```bash\n# Run WPF sample\ndotnet run --project samples/WPFSample/WPFSample.csproj\n\n# Run Avalonia sample\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\n\n# Run Console sample (no UI)\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n```\n\n### Adding New Samples\n1. Add ViewModel class in `samples/ViewModelsSamples/[Category]/[Name].cs`\n2. Add path to `samples/ViewModelsSamples/Index.cs`\n3. Create platform-specific view files in each sample project (WPF, Avalonia, etc.)\n\n### Sample Platforms Reference\n\nThe following platforms each need a view for every sample. **ConsoleSample** and **VorticeSample** are excluded — they don't follow this pattern.\n\n| Platform | Root path | View file(s) | Base class | LVC namespace (xmlns:lvc) |\n|---|---|---|---|---|\n| **Avalonia** | `samples/AvaloniaSample/[Category]/[Name]/` | `View.axaml` + `View.axaml.cs` | `UserControl` | `using:LiveChartsCore.SkiaSharpView.Avalonia` |\n| **WPF** | `samples/WPFSample/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `UserControl` | `clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF` |\n| **MAUI** | `samples/MauiSample/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `ContentPage` | `clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui` |\n| **WinUI** | `samples/WinUISample/WinUISample/Samples/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `UserControl` (`sealed partial`) | `using:LiveChartsCore.SkiaSharpView.WinUI` |\n| **WinForms** | `samples/WinFormsSample/[Category]/[Name]/` | `View.cs` + `View.Designer.cs` + `View.resx` | `UserControl` (`partial`) | N/A — code-only |\n| **Blazor** | `samples/BlazorSample/Pages/[Category]/[Name]/` | `View.razor` | N/A — Razor component | `@using LiveChartsCore.SkiaSharpView.Blazor` |\n| **EtoForms** | `samples/EtoFormsSample/[Category]/[Name]/` | `View.cs` | `Panel` (non-partial) | N/A — code-only |\n| **UnoPlatform** | *(no separate files)* | Reuses `WinUISample` views via reflection | — | — |\n\n**Key facts for each platform:**\n\n- **All XAML platforms (Avalonia, WPF, MAUI, WinUI)** use `Activator.CreateInstance` with the pattern `{Platform}.{Category}.{Name}.View` to load views — so the **C# namespace must exactly match** `{PlatformPrefix}.{Category}.{Name}` and the class must be named `View`.\n- **WinForms** and **EtoForms** use the same reflection pattern. The view class must be `partial class View : UserControl` (WinForms) or `class View : Panel` (EtoForms).\n- **Blazor** uses Razor's `@page \"/{Category}/{Name}\"` directive for routing. The nav menu reads `ViewModelsSamples.Index.Samples` automatically.\n- **UnoPlatform** (`samples/UnoPlatformSample/`) loads views from the `WinUISample` assembly — no separate files are needed.\n\n**XAML DataContext / BindingContext patterns:**\n\n```xml\n<!-- Avalonia (View.axaml) -->\n<UserControl xmlns:lvc=\"using:LiveChartsCore.SkiaSharpView.Avalonia\"\n             xmlns:vms=\"using:ViewModelsSamples.[Category].[Name]\"\n             x:DataType=\"vms:ViewModel\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n\n<!-- WPF (View.xaml) -->\n<UserControl xmlns:lvc=\"clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF\"\n             xmlns:vms=\"clr-namespace:ViewModelsSamples.[Category].[Name];assembly=ViewModelsSamples\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n\n<!-- MAUI (View.xaml) — ContentPage + XamlCompilation attribute on code-behind -->\n<ContentPage xmlns:lvc=\"clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui\"\n             xmlns:vms=\"clr-namespace:ViewModelsSamples.[Category].[Name];assembly=ViewModelsSamples\"\n             x:DataType=\"vms:ViewModel\">\n    <ContentPage.BindingContext><vms:ViewModel/></ContentPage.BindingContext>\n</ContentPage>\n\n<!-- WinUI (View.xaml) — sealed partial class -->\n<UserControl xmlns:lvc=\"using:LiveChartsCore.SkiaSharpView.WinUI\"\n             xmlns:vms=\"using:ViewModelsSamples.[Category].[Name]\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n```\n\n**Code-only platforms (WinForms / EtoForms)** typically instantiate the ViewModel directly or inline the data:\n\n```csharp\n// WinForms — partial class View : UserControl\nvar vm = new ViewModel();\nvar chart = new GeoMap { Series = vm.Series, ... };\nchart.Location = new System.Drawing.Point(0, 0);\nchart.Size = new System.Drawing.Size(50, 50);\nchart.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;\nControls.Add(chart);\n\n// EtoForms — class View : Panel (non-partial, no Designer file)\nvar vm = new ViewModel();\nvar chart = new GeoMap { Series = vm.Series, ... };\nContent = new DynamicLayout(chart);\n```\n\n**WinForms `View.Designer.cs`** is always a minimal boilerplate — copy from any existing sample, just update the namespace.\n\n**UI-testing accessor** — most XAML views expose a `Chart` property under `#if UI_TESTING` for the Factos test runner:\n\n```csharp\n// XAML platforms (WPF, Avalonia, MAUI, WinUI)\n#if UI_TESTING\n    public SomeChartType Chart => chartNamedInXaml;\n#endif\n\n// EtoForms / WinForms\npublic SomeChartType Chart;  // public field, always present\n```\n\n**Blazor** exposes the chart via `@ref`:\n```razor\n<CartesianChart @ref=\"Chart\" .../>\n@code { public CartesianChart Chart; }\n```\n\n## Code Style and Conventions\n\n### Editor Config\nThe repository uses `.editorconfig` based on [.NET Runtime coding style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) with exceptions.\n\n**Key Style Rules:**\n- **Indentation**: 4 spaces\n- **Line endings**: LF, insert final newline\n- **Braces**: New line before open brace (Allman style)\n- **var usage**: Use `var` freely (explicitly allowed)\n- **Single-line if**: Allowed and preferred when line is short\n- **Naming**:\n  - Private/internal fields: `_camelCase`\n  - Static private fields: `s_camelCase`\n  - Constants: `PascalCase`\n- **Using directives**: Outside namespace\n\n### File Naming\n**Critical for auto-generated documentation:**\n- File names MUST match the class name exactly\n- `public class Hello` → `Hello.cs`\n- `public class Hello<T>` → `Hello.cs` (ignore generics)\n- Generic and non-generic with same name → same file (only if inheritance relationship)\n\n### Important Constants\nDefined in `Directory.Build.props`:\n- `LiveChartsVersion`: Current version (2.0.0-rc6.1)\n- `MinSkiaSharpVersion`: 2.88.9\n- `LatestSkiaSharpVersion`: 3.119.0\n- `LangVersion`: 14.0 (C# 14)\n\n## Build Configuration Properties\n\n### Rendering Settings\nRendering settings are configured via MSBuild properties:\n- `GPU`: Enable/disable GPU acceleration\n- `VSYNC`: Enable/disable vertical sync\n- `FPS`: Frame rate (10, 20, 30, 45, 60, 75, 90, 120)\n- `Diagnose`: Enable diagnostic mode\n\nThese create conditional compilation symbols for testing different rendering modes.\n\n### Development Flags\nIn `Directory.Build.props`:\n- `UseNuGetForSamples`: Use NuGet packages vs project references (default: false)\n- `UseNuGetForGenerator`: Use NuGet generator package (default: true)\n\n## CI/CD\n\n### GitHub Actions Workflows\n\n#### 1. Main CI (`livecharts.yml`)\n- Triggers: Pull requests\n- Runs on: `windows-2025` (pack/test), `ubuntu-24.04` (Linux/browser), `macos-26` (Mac/iOS)\n- Steps:\n  1. **Pack**: Builds NuGet packages for all platform libraries (core, skiasharp, WPF, Avalonia, MAUI, Blazor, WinUI, UNO, WinForms, Eto)\n  2. **test-core**: Runs `CoreTests` on `net8.0` and `net462`\n  3. **test-snapshot**: Runs `SnapshotTests`\n  4. **test-windows/linux/mac/browser/android/ios**: Runs Factos UI tests for each platform\n- On tag pushes (after tests pass): publishes packages to NuGet.org\n\n#### 2. Publish (`publish.yml`)\n- Handles NuGet package publishing\n\n**Note**: The CI uses NuGet packages (not project references) when running UI tests in Release mode.\n\n## Common Development Workflows\n\n### Adding a New Series Type\n1. Create series class in `src/LiveChartsCore/[SeriesType]/`\n2. Implement series interfaces (`ISeries`, etc.)\n3. Create SkiaSharp drawable in `src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/`\n4. Add tests in `tests/CoreTests/SeriesTests/`\n5. Create sample ViewModel in `samples/ViewModelsSamples/`\n6. Update `samples/ViewModelsSamples/Index.cs`\n\n### Adding Platform Support\n1. Create new project in `src/skiasharp/LiveChartsCore.SkiaSharpView.[Platform]/`\n2. Reference `LiveChartsCore.SkiaSharp` project\n3. Create platform-specific control classes\n4. Add shared code to `_Shared/` if applicable\n5. Create sample application in `samples/[Platform]Sample/`\n6. Add platform-specific solution file\n\n### Updating Documentation\n\n**Important**: Documentation files in the `docs/` folder are **Scriban templates**, not final markdown files.\n\n**How it works:**\n1. Template files are compiled by an external (non-open-source) repository\n2. Templates use [Scriban](https://github.com/scriban/scriban) - a fast, powerful, and lightweight text templating language\n3. Scriban supports custom functions and expressions embedded in the markdown\n\n**Common Scriban expressions you'll find:**\n\n**File inclusion** - Renders content from source files:\n```\n{{~ render \"~/../samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs\" ~}}\n{{~ render \"~/../samples/MauiSample/MauiProgram.cs\" ~}}\n{{~ render \"~/../samples/{samples_folder}/Events/Cartesian{view_extension}\" ~}}\n```\n\n**Conditionals** - Platform-specific content:\n```\n{{~ if xaml ~}}\n  Content for XAML platforms (WPF, Avalonia, UNO, WinUI, MAUI)\n{{~ end ~}}\n\n{{~ if winforms ~}}\n  Content specific to WinForms\n{{~ end ~}}\n```\n\n**Variables** - Dynamic content:\n```\n{{ website_url }}/docs/{{ platform }}/{{ version }}/About\n{{ assets_url }}/docs/{{ unique_name }}/result.gif\n{{ name | to_title_case }}\n{{ edit_source | replace_local_to_server }}\n```\n\n**Loops** - Iterate over collections:\n```\n{{~ for r in related_to ~}}\n  <a href=\"{{ compile this r.url }}\">{{ r.name }}</a>\n{{~ end ~}}\n```\n\n**Template structure:**\n- `docs/samples/[category]/[name]/template.md` - Sample documentation templates\n- `docs/shared/*.md` - Reusable template fragments included via `{{ render \"~/shared/...\" }}`\n- `docs/piechart/`, `docs/cartesianChart/`, etc. - Feature documentation with templates\n\n**When editing docs:**\n- Always edit the `.md` files as Scriban templates\n- Test template syntax (though final compilation happens externally)\n- Use `{{~ ~}}` syntax to strip whitespace around expressions\n- File paths in `render` are relative to the template location (use `~/../` for repo root)\n\n## Important Notes for Coding Agents\n\n### Do's\n- ✅ Use project references during development (not NuGet packages)\n- ✅ Follow the exact file naming convention (critical for docs)\n- ✅ Run tests after changes to core or series logic\n- ✅ Use platform-specific solution files for focused development\n- ✅ Consult `CONTRIBUTING.md` for detailed style guide\n- ✅ Use shared code in `_Shared/` folders when adding cross-platform features\n\n### Don'ts\n- ❌ Don't break multi-platform support when modifying core projects\n- ❌ Don't add platform-specific code to `LiveChartsCore` (keep it agnostic)\n- ❌ Don't ignore `.editorconfig` warnings\n- ❌ Don't remove or modify working tests without good reason\n- ❌ Don't add new dependencies without checking compatibility across all target frameworks\n\n### Special Considerations\n- The library supports .NET Framework 4.6.2 - maintain compatibility\n- SkiaSharp is abstracted - core library should work with other rendering engines\n- Animation system (`Motion/`) is critical - changes require extensive testing\n- Multi-threading: Chart updates can come from any thread; proper synchronization is essential\n\n## Quick Reference Commands\n\n```bash\n# === Building ===\n# Build core library (no workloads needed)\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n\n# Build platform-specific projects\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# === Install Workloads (for platform-specific projects) ===\ndotnet workload install maui --skip-sign-check\ndotnet workload install wasm-tools --skip-sign-check\n\n# Check installed workloads\ndotnet workload list\n\n# === Testing ===\n# Run core unit tests\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Run snapshot tests\ndotnet test tests/SnapshotTests/\n\n# Run UI tests (requires sample apps to build)\ndotnet run --project tests/UITests/\n\n# Run UI tests for specific platform\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\n\n# === Running Samples ===\n# Run WPF sample\ndotnet run --project samples/WPFSample/WPFSample.csproj\n\n# Run Avalonia sample\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\n\n# Run Console sample (no UI)\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n\n# === Troubleshooting ===\n# Clean build artifacts\ndotnet clean\nfind . -type d -name \"bin\" -o -name \"obj\" | xargs rm -rf\n\n# Restore packages\ndotnet restore\n\n# Check for workload issues\ndotnet workload restore --skip-sign-check\n```\n\n## Documented Errors and Workarounds\n\nThis section documents actual errors encountered when working with this repository and their solutions.\n\n### Error 1: NETSDK1147 - Missing Workloads\n\n**Error Message:**\n```\nerror NETSDK1147: To build this project, the following workloads must be installed: maui\nTo install these workloads, run the following command: dotnet workload restore\n```\n\n**Context**: This occurs when building platform-specific view projects (MAUI, UNO, Avalonia Browser) that require specific workloads. Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) do NOT require any workloads.\n\n**Workarounds:**\n\n**Option 1: Install Required Workloads**\n```bash\ndotnet workload install maui --skip-sign-check\ndotnet workload install wasm-tools --skip-sign-check\n```\n\n**Option 2: Build Platform-Specific Projects that don't need workloads**\n```bash\n# Build only WPF (Windows only)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\n\n# Build only Avalonia desktop (cross-platform)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# Use platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\n```\n\n### Error 2: Visual Studio Component Required\n\n**Error Message:**\n```\nUnhandled exception: The imported file \"$(MSBuildExtensionsPath32)/Microsoft/VisualStudio/v$(VisualStudioVersion)/CodeSharing/Microsoft.CodeSharing.Common.Default.props\" does not exist and appears to be part of a Visual Studio component.\n```\n\n**Context**: Appears when running `dotnet workload restore` on non-Windows systems or when Visual Studio is not installed.\n\n**Why it happens**: The `src/skiasharp/_Shared.WinUI/_Shared.WinUI.shproj` shared project requires Visual Studio components that are Windows-specific.\n\n**Workaround**: This error can be ignored if you're not building WinUI projects. The workload installation succeeds despite this error. If you need to build WinUI:\n- Use Windows with Visual Studio 2022 installed\n- Use `msbuild` instead of `dotnet build` for WinUI projects\n\n### Error 3: Ambiguous Argument with Git\n\n**Error Message:**\n```\nfatal: ambiguous argument 'origin/branch-name': unknown revision or path not in the working tree.\n```\n\n**Context**: After fetching a branch with `git fetch origin branch-name`, trying to reference it as `origin/branch-name`.\n\n**Why it happens**: Git fetch stores the ref as `FETCH_HEAD`, not as a trackable remote branch.\n\n**Solution**: Use `FETCH_HEAD` or create a local tracking branch:\n```bash\n# Option 1: Use FETCH_HEAD directly\ngit log FETCH_HEAD\n\n# Option 2: Create tracking branch\ngit fetch origin main\ngit checkout -b main --track origin/main\n\n# Option 3: Fetch with branch creation\ngit fetch origin main:main\n```\n\n### Error 4: Package Not Found During Build\n\n**Context**: Sample applications may fail to build if NuGet packages are not found.\n\n**Why it happens**: `UseNuGetForSamples` flag in `Directory.Build.props` controls whether samples use project references or NuGet packages.\n\n**Solution**: Ensure you're using project references during development:\n```xml\n<!-- In Directory.Build.props -->\n<UseNuGetForSamples>false</UseNuGetForSamples>\n```\n\nOr restore NuGet packages if building from packages:\n```bash\ndotnet restore\n```\n\n### Error 5: Strong Name Assembly Conflicts\n\n**Context**: When building for .NET Framework 4.6.2, you may encounter assembly version conflicts.\n\n**Why it happens**: .NET Framework uses strong-named assemblies, and SkiaSharp has different versioning.\n\n**Referenced Issue**: https://github.com/mono/SkiaSharp/issues/3153\n\n**Solution**: The project is configured to handle this, but if you encounter issues:\n1. Clean the solution: `dotnet clean`\n2. Delete `bin` and `obj` folders\n3. Restore and rebuild: `dotnet restore && dotnet build`\n\n### Error 6: Test Build Failures on CI\n\n**Context**: UI tests may fail with target framework mismatches in CI.\n\n**Solution**: The UI test infrastructure uses special MSBuild properties:\n- `TestBuildTargetFramework`: Override target framework for test builds\n- `IsTestBuild`: Flag to indicate test build\n- `UITesting`: Flag to include shared UI tests\n\nExample from `tests/UITests/Program.cs`:\n```csharp\nMSBuildArg tf_n10w = new(\"TestBuildTargetFramework\", \"net10.0-windows\");\nMSBuildArg isTest = new(\"IsTestBuild\", \"true\");\n```\n\n## Troubleshooting\n\n### Problem: Can't build platform-specific projects - workload errors\n**Solution**: Install the required workload for the platform you're targeting (e.g., `dotnet workload install maui`). Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) build without any workloads.\n\n### Problem: SkiaSharp errors\n**Solution**: Check SkiaSharp version in `Directory.Build.props`, ensure NuGet restore succeeded\n\n### Problem: Tests fail with animation issues\n**Solution**: Verify `CoreMotionCanvas.IsTesting = true` in test initialization\n\n### Problem: Sample won't run\n**Solution**: Ensure platform-specific dependencies are installed (e.g., .NET Desktop Runtime for WPF)\n\n### Problem: Generator errors\n**Solution**: Check `UseNuGetForGenerator` setting and ensure LiveChartsGenerators package/project is available\n\n## Issue Reproduction & Fix Workflow\n\nWhen picking up a GitHub issue (reproduce → diagnose → fix → regression test → PR),\nfollow the canonical workflow at [`.claude/skills/repro-and-fix/SKILL.md`](../.claude/skills/repro-and-fix/SKILL.md).\nThat doc is the single source of truth for both Claude Code and Copilot Coding Agent —\nkeep edits there, not duplicated here.\n\nQuick reference for the dev-loop hooks the workflow relies on:\n\n- **`LVC_SAMPLE=<sample-path>`** — XAML samples (Avalonia / WPF / WinUI / MAUI / Uno) auto-navigate to the named sample on launch, e.g. `LVC_SAMPLE=VisualTest/Issue1986Repro`. Skips manual UI navigation for repros.\n- **`LVC_SCREENSHOT=<png-path>`** — Avalonia / WPF / WinUI samples render the main window to PNG via `RenderTargetBitmap` shortly after activation and exit. Captures scale to physical pixels on HiDPI.\n- **`LVC_SCREENSHOT_DELAY_MS=<ms>`** — overrides the 3 s default settle delay before the in-app screenshot is taken (use on slower CI hosts).\n- **`.claude/scripts/capture-window.{ps1,-macos.sh,-linux.sh}`** — per-OS PrintWindow / `screencapture` / `grim` fallbacks for platforms without an in-app capture path (MAUI, Uno).\n\nRepro views live under `samples/AvaloniaSample/VisualTest/Issue<N>Repro/` (or\nthe equivalent under whichever platform sample fits the bug). Their code-behind\nexposes helpers (e.g. `FindTemplatedGaugeSeries()`) that Factos UI tests call\ndirectly. Factos and `LVC_SAMPLE` navigate by path and don't need the repro\nregistered in `samples/ViewModelsSamples/Index.cs` — **do not commit changes\nto that file for a repro view.** It's shared across every platform sample,\nso a single-platform repro entry will crash the load on the other platforms.\n\n## Resources\n\n- **Main Documentation**: https://livecharts.dev\n- **Contributing Guide**: `CONTRIBUTING.md`\n- **Repository**: https://github.com/Live-Charts/LiveCharts2\n- **Code of Conduct**: `CODE_OF_CONDUCT.md`\n- **License**: MIT (see `LICENSE`)\n\n## Version Information\n\n- **Current Version**: 2.0.0-rc6.1 (Release Candidate)\n- **C# Language Version**: 14.0\n- **SkiaSharp**: 2.88.9 (min) to 3.119.0 (latest)\n- **Target Frameworks**: `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows` (core); plus platform-specific targets for view projects\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nLiveCharts2 is a cross-platform .NET charting library with a layered architecture:\n- **`src/LiveChartsCore/`** — Platform-agnostic core (math, series, axes, animation). No UI dependencies. Targets `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows`.\n- **`src/skiasharp/LiveChartsCore.SkiaSharp/`** — SkiaSharp rendering backend implementing the core drawing abstractions.\n- **`src/skiasharp/LiveChartsCore.SkiaSharp.{Platform}/`** — Platform-specific view controls (WPF, Avalonia, MAUI, Blazor, WinForms, WinUI, Eto, UNO).\n- **`generators/LiveChartsGenerators/`** — Roslyn source generator for boilerplate reduction.\n\n## Build Commands\n\n```bash\n# Core library (no workloads needed)\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n\n# Platform-specific (examples)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# Platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\ndotnet build LiveCharts.Avalonia.slnx\ndotnet build LiveCharts.Maui.slnx\n\n# Target a specific framework when multi-targeting causes issues\ndotnet build -f net8.0\n```\n\nMAUI/WASM projects require workloads: `dotnet workload install maui --skip-sign-check` / `dotnet workload install wasm-tools --skip-sign-check`. Core and desktop projects (WPF, Avalonia, WinForms) do not.\n\n## Testing\n\n```bash\n# Unit tests (MSTest) — primary test suite\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Snapshot tests (image comparison, net10.0 only)\ndotnet test tests/SnapshotTests/\n\n# UI tests via Factos (requires sample apps built)\ndotnet run --project tests/UITests/\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\n```\n\nTests use `CoreMotionCanvas.IsTesting = true` to disable animations. UI tests are defined in `tests/SharedUITests/` (shared project) and run against each platform via the Factos orchestrator in `tests/UITests/`.\n\n## Running Samples\n\n```bash\ndotnet run --project samples/WPFSample/WPFSample.csproj\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n```\n\nSample ViewModels live in `samples/ViewModelsSamples/` and are shared across all platform samples. Each platform sample creates its own views. `samples/ViewModelsSamples/Index.cs` lists all available sample paths.\n\n## Architecture Details\n\n**Rendering pipeline**: Data → Core series engine (measurement, layout) → SkiaSharp drawables → Platform-native surface. The core is rendering-agnostic — `samples/VorticeSample/` demonstrates using DirectX instead of SkiaSharp.\n\n**Shared projects**: `src/skiasharp/_Shared/`, `_Shared.Xaml/`, `_Shared.WinUI/` contain code shared across platform views via MSBuild linked files (configured in `build/*.Build.props`).\n\n**Code generation**: `LiveChartsGenerators` is a Roslyn analyzer/generator. Controlled by `UseNuGetForGenerator` in `Directory.Build.props` (default: `true` = NuGet package).\n\n**Key build properties** (`Directory.Build.props`):\n- `UseNuGetForSamples`: `false` during development (project references), `true` for CI/release\n- `UITesting`: set to `true` to include shared UI tests in sample projects\n- `GPU`, `VSYNC`, `Diagnose`: rendering mode overrides for testing\n\n## Code Style\n\nBased on [.NET Runtime coding style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) with these exceptions (enforced via `.editorconfig`):\n- `var` is freely used everywhere (not restricted to explicit right-hand types)\n- Single-line `if` without braces is preferred when the line is short; break long lines rather than adding braces\n- Private fields: `_camelCase`, static private: `s_camelCase`, constants: `PascalCase`\n- 4-space indentation, Allman braces, LF line endings\n\n**File naming is critical**: file names must match the class name exactly (`Hello<T>` → `Hello.cs`). Generic and non-generic with the same name go in the same file (only when related by inheritance). This is required for automatic documentation generation.\n\n## Key Constraints\n\n- **Never add platform-specific code to `LiveChartsCore`** — it must remain platform-agnostic\n- **.NET Framework 4.6.2 compatibility must be maintained** (strong-named assemblies, `LiveCharts.snk`)\n- **SkiaSharp version range**: min 2.88.9, latest 3.119.0 — changes must respect both\n- **C# 14.0** language version\n- Animation system (`Motion/`) is core infrastructure — changes require extensive testing\n- Chart updates can arrive from any thread; synchronization is essential\n\n## Additional Documentation\n\nSee `.github/copilot-instructions.md` for extended guidance including: sample platform view patterns (XAML/code-only/Blazor), adding new series types, CI/CD workflow details, and documented build errors with workarounds.\n","category":"root","tokens":1284},{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","title":"copilot-instructions.md","content":"# LiveCharts2 Copilot Instructions\n\nThis document helps coding agents work efficiently with the LiveCharts2 repository.\n\n## Repository Overview\n\nLiveCharts2 is a flexible, cross-platform charting library for .NET. It follows a layered architecture where:\n- **Core library** (`LiveChartsCore`) is platform-agnostic and handles all chart mathematics\n- **SkiaSharp backend** renders the charts using SkiaSharp\n- **Platform-specific views** provide UI controls for various frameworks (WPF, Avalonia, MAUI, Blazor, etc.)\n\n## Repository Structure\n\n```\nLiveCharts2/\n├── src/\n│   ├── LiveChartsCore/                    # Platform-agnostic core library\n│   │   ├── Kernel/                        # Core charting engine\n│   │   ├── Drawing/                       # Drawing abstractions\n│   │   ├── Motion/                        # Animation system\n│   │   ├── Measure/                       # Chart measurement logic\n│   │   └── [Series types]/                # Line, Bar, Pie, Scatter, etc.\n│   ├── skiasharp/                         # SkiaSharp rendering implementations\n│   │   ├── LiveChartsCore.SkiaSharp/      # Core SkiaSharp provider\n│   │   ├── LiveChartsCore.SkiaSharp.WPF/\n│   │   ├── LiveChartsCore.SkiaSharp.Avalonia/\n│   │   ├── LiveChartsCore.SkiaSharpView.Maui/\n│   │   ├── LiveChartsCore.SkiaSharpView.Blazor/\n│   │   └── [other platforms]/\n│   └── _Shared.Native/                    # Native platform interop\n├── samples/                               # Sample applications\n│   ├── ViewModelsSamples/                 # Shared ViewModels for all samples\n│   │   └── Index.cs                       # List of all sample paths\n│   ├── WPFSample/\n│   ├── AvaloniaSample/\n│   ├── MauiSample/\n│   ├── VorticeSample/                     # DirectX sample (core without SkiaSharp)\n│   └── [other platforms]/\n├── tests/\n│   ├── CoreTests/                         # Core unit tests using MSTest\n│   │   ├── ChartTests/                    # High-level chart tests\n│   │   ├── SeriesTests/                   # Series-specific tests\n│   │   ├── LayoutTests/                   # Layout tests\n│   │   ├── CoreObjectsTests/              # Core objects tests\n│   │   └── OtherTests/                    # Axes, events, etc.\n│   ├── SnapshotTests/                     # Snapshot/image comparison tests (net10.0)\n│   ├── UITests/                           # UI testing orchestrator\n│   │   └── Program.cs                     # Factos-based multi-platform test runner\n│   └── SharedUITests/                     # Shared UI tests (referenced by sample apps)\n│       ├── CartesianChartTests.cs\n│       ├── PieChartTests.cs\n│       ├── PolarChartTests.cs\n│       └── MapChartTests.cs\n├── docs/                                  # Documentation (Scriban templates)\n│   ├── samples/                           # Sample documentation templates\n│   ├── shared/                            # Reusable template fragments\n│   ├── cartesianChart/                    # Cartesian chart docs\n│   ├── piechart/                          # Pie chart docs\n│   └── polarchart/                        # Polar chart docs\n└── generators/                            # Code generators\n```\n\n## Key Architecture Concepts\n\n### 1. Layered Design\n- **LiveChartsCore**: Pure .NET, no UI dependencies, handles all calculations\n- **SkiaSharp Provider**: Implements `IDrawingProvider` to render using SkiaSharp\n- **Platform Views**: WPF/Avalonia/MAUI/etc. specific controls that host the renderer\n\n### 2. Multi-Platform Targeting\n\nCore projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) target:\n- `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows`\n- **No mobile workloads required** to build the core library\n\n**Platform-specific view projects** (WPF, Avalonia, MAUI, etc.) have their own target framework requirements based on the platform.\n\n### 3. Sample Structure\n- **ViewModelsSamples**: Contains shared ViewModels used across all UI frameworks\n- **Index.cs**: Defines available samples as string paths (e.g., \"Lines/Basic\", \"Pies/Doughnut\")\n- Each platform sample project (WPF, Avalonia, etc.) references ViewModelsSamples and creates platform-specific views\n\n### 4. VorticeSample\nA special sample demonstrating how to use LiveChartsCore without SkiaSharp, using DirectX instead. This shows the core library is truly rendering-agnostic.\n\n## Building the Repository\n\n### Prerequisites\n- .NET SDK (see `global.json` for minimum version)\n- No workloads required for core projects\n- Platform-specific projects (MAUI, UNO, Avalonia Browser) require relevant workloads:\n  ```bash\n  dotnet workload install maui\n  dotnet workload install wasm-tools\n  ```\n\n### Build Methods\n\n#### Quick Build - Core Projects\n```bash\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n```\n\n#### Quick Build - Platform Views\n```bash\n# Build specific platform views (recommended for development)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n```\n\n#### Full Build (Windows)\n```bash\n# Build platform-specific projects individually\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj\n# Or use platform-specific solution files (see below)\n```\n\n#### Build with Solution Files\n```bash\n# Use platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\ndotnet build LiveCharts.Avalonia.slnx\ndotnet build LiveCharts.Maui.slnx\n```\n\n### Common Build Issues and Workarounds\n\n#### Issue: Missing workload errors (NETSDK1147)\n```\nerror NETSDK1147: To build this project, the following workloads must be installed: maui\n```\n\n**Context**: This error occurs when building platform-specific view projects (MAUI, UNO, Avalonia Browser) that require specific workloads. Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) do NOT require workloads.\n\n**Workaround Options:**\n1. Install the required workload: `dotnet workload install maui`\n2. Build only the platform you need (e.g., WPF or Avalonia desktop on Windows)\n3. Use platform-specific solution files that don't include all targets\n\n#### Issue: SkiaSharp version conflicts\nThe project supports multiple SkiaSharp versions:\n- `MinSkiaSharpVersion`: 2.88.9 (minimum supported)\n- `LatestSkiaSharpVersion`: 3.119.0 (default for GPU support)\n\nDefined in `Directory.Build.props`.\n\n#### Issue: Multi-targeting complexity\nWhen building fails for specific targets, you can:\n1. Use `-f` to target specific framework: `dotnet build -f net8.0`\n2. Edit `TargetFrameworks` in .csproj to focus on needed platforms\n\n## Testing\n\n### Unit Tests (Core Library)\n\n**Location**: `tests/CoreTests/`\n\n**Framework**: MSTest with coverlet for code coverage\n\n**Run Tests:**\n```bash\ndotnet test tests/CoreTests/\n\n# Run for specific framework\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Run with coverage\ndotnet test tests/CoreTests/ --collect:\"XPlat Code Coverage\"\n```\n\n**Test Structure:**\n- `ChartTests/`: High-level chart functionality\n- `SeriesTests/`: Tests for Line, Bar, Pie, Scatter, Heat, etc.\n- `LayoutTests/`: Stack and table layouts\n- `CoreObjectsTests/`: Transitions, colors, labels\n- `OtherTests/`: Axes, events, data providers, visual elements\n- `MockedObjects/`: Test helpers and mocks\n- `TestsInitializer.cs`: MSTest assembly initialization\n\n**Important**: Tests use `CoreMotionCanvas.IsTesting = true` to disable animations during testing.\n\n### Snapshot Tests\n\n**Location**: `tests/SnapshotTests/`\n\n**Framework**: MSTest, targets `net10.0`\n\nSnapshot tests render charts to images and compare them against stored reference snapshots. They are run in CI on Windows.\n\n**Run Tests:**\n```bash\ndotnet test tests/SnapshotTests/\n```\n\n### UI Testing\n\n**Location**: `tests/UITests/` (orchestrator) and `tests/SharedUITests/` (shared tests)\n\n**Framework**: [Factos](https://github.com/beto-rodriguez/Factos) - A multi-platform UI testing framework\n\n**How it works:**\n1. Shared UI tests are defined in `tests/SharedUITests/` (shared project)\n2. Each sample application references `SharedUITests` \n3. The `tests/UITests/Program.cs` orchestrator:\n   - Starts various sample applications (Avalonia, WPF, MAUI, Blazor, etc.)\n   - Connects to them via Factos\n   - Runs the shared UI tests against each platform\n4. Tests ensure charts render correctly across all supported UI frameworks\n\n**Test Coverage:**\n- `CartesianChartTests.cs`: Cartesian chart rendering and behavior\n- `PieChartTests.cs`: Pie/Doughnut chart tests\n- `PolarChartTests.cs`: Polar chart tests  \n- `MapChartTests.cs`: Map chart tests\n- `AvaloniaTests.cs`: Avalonia-specific tests\n\n**Running UI Tests:**\n```bash\n# Run UI tests (requires sample apps to be built)\ndotnet run --project tests/UITests/\n\n# Run against specific platform (see Program.cs for options)\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\ndotnet run --project tests/UITests/ -- --select maui --test-env \"tf=net10.0-windows10.0.19041.0\"\n```\n\n**Important Notes:**\n- UI testing requires the Factos package\n- Each platform may need specific prerequisites (emulators for mobile, browsers for web)\n- In Debug mode, tests use project references; in Release mode, they use NuGet packages\n- The orchestrator supports testing against multiple target frameworks\n- Mobile platforms (Android, iOS) require running emulators\n\n**Build Configuration for UI Tests:**\nUI test configuration is managed through MSBuild properties. When `UITesting=true` is set, samples include the shared UI test project.\n\n## Running Samples\n\n### Sample Applications\nEach platform has its own sample application that references `ViewModelsSamples`:\n\n```bash\n# Run WPF sample\ndotnet run --project samples/WPFSample/WPFSample.csproj\n\n# Run Avalonia sample\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\n\n# Run Console sample (no UI)\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n```\n\n### Adding New Samples\n1. Add ViewModel class in `samples/ViewModelsSamples/[Category]/[Name].cs`\n2. Add path to `samples/ViewModelsSamples/Index.cs`\n3. Create platform-specific view files in each sample project (WPF, Avalonia, etc.)\n\n### Sample Platforms Reference\n\nThe following platforms each need a view for every sample. **ConsoleSample** and **VorticeSample** are excluded — they don't follow this pattern.\n\n| Platform | Root path | View file(s) | Base class | LVC namespace (xmlns:lvc) |\n|---|---|---|---|---|\n| **Avalonia** | `samples/AvaloniaSample/[Category]/[Name]/` | `View.axaml` + `View.axaml.cs` | `UserControl` | `using:LiveChartsCore.SkiaSharpView.Avalonia` |\n| **WPF** | `samples/WPFSample/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `UserControl` | `clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF` |\n| **MAUI** | `samples/MauiSample/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `ContentPage` | `clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui` |\n| **WinUI** | `samples/WinUISample/WinUISample/Samples/[Category]/[Name]/` | `View.xaml` + `View.xaml.cs` | `UserControl` (`sealed partial`) | `using:LiveChartsCore.SkiaSharpView.WinUI` |\n| **WinForms** | `samples/WinFormsSample/[Category]/[Name]/` | `View.cs` + `View.Designer.cs` + `View.resx` | `UserControl` (`partial`) | N/A — code-only |\n| **Blazor** | `samples/BlazorSample/Pages/[Category]/[Name]/` | `View.razor` | N/A — Razor component | `@using LiveChartsCore.SkiaSharpView.Blazor` |\n| **EtoForms** | `samples/EtoFormsSample/[Category]/[Name]/` | `View.cs` | `Panel` (non-partial) | N/A — code-only |\n| **UnoPlatform** | *(no separate files)* | Reuses `WinUISample` views via reflection | — | — |\n\n**Key facts for each platform:**\n\n- **All XAML platforms (Avalonia, WPF, MAUI, WinUI)** use `Activator.CreateInstance` with the pattern `{Platform}.{Category}.{Name}.View` to load views — so the **C# namespace must exactly match** `{PlatformPrefix}.{Category}.{Name}` and the class must be named `View`.\n- **WinForms** and **EtoForms** use the same reflection pattern. The view class must be `partial class View : UserControl` (WinForms) or `class View : Panel` (EtoForms).\n- **Blazor** uses Razor's `@page \"/{Category}/{Name}\"` directive for routing. The nav menu reads `ViewModelsSamples.Index.Samples` automatically.\n- **UnoPlatform** (`samples/UnoPlatformSample/`) loads views from the `WinUISample` assembly — no separate files are needed.\n\n**XAML DataContext / BindingContext patterns:**\n\n```xml\n<!-- Avalonia (View.axaml) -->\n<UserControl xmlns:lvc=\"using:LiveChartsCore.SkiaSharpView.Avalonia\"\n             xmlns:vms=\"using:ViewModelsSamples.[Category].[Name]\"\n             x:DataType=\"vms:ViewModel\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n\n<!-- WPF (View.xaml) -->\n<UserControl xmlns:lvc=\"clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF\"\n             xmlns:vms=\"clr-namespace:ViewModelsSamples.[Category].[Name];assembly=ViewModelsSamples\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n\n<!-- MAUI (View.xaml) — ContentPage + XamlCompilation attribute on code-behind -->\n<ContentPage xmlns:lvc=\"clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui\"\n             xmlns:vms=\"clr-namespace:ViewModelsSamples.[Category].[Name];assembly=ViewModelsSamples\"\n             x:DataType=\"vms:ViewModel\">\n    <ContentPage.BindingContext><vms:ViewModel/></ContentPage.BindingContext>\n</ContentPage>\n\n<!-- WinUI (View.xaml) — sealed partial class -->\n<UserControl xmlns:lvc=\"using:LiveChartsCore.SkiaSharpView.WinUI\"\n             xmlns:vms=\"using:ViewModelsSamples.[Category].[Name]\">\n    <UserControl.DataContext><vms:ViewModel/></UserControl.DataContext>\n</UserControl>\n```\n\n**Code-only platforms (WinForms / EtoForms)** typically instantiate the ViewModel directly or inline the data:\n\n```csharp\n// WinForms — partial class View : UserControl\nvar vm = new ViewModel();\nvar chart = new GeoMap { Series = vm.Series, ... };\nchart.Location = new System.Drawing.Point(0, 0);\nchart.Size = new System.Drawing.Size(50, 50);\nchart.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;\nControls.Add(chart);\n\n// EtoForms — class View : Panel (non-partial, no Designer file)\nvar vm = new ViewModel();\nvar chart = new GeoMap { Series = vm.Series, ... };\nContent = new DynamicLayout(chart);\n```\n\n**WinForms `View.Designer.cs`** is always a minimal boilerplate — copy from any existing sample, just update the namespace.\n\n**UI-testing accessor** — most XAML views expose a `Chart` property under `#if UI_TESTING` for the Factos test runner:\n\n```csharp\n// XAML platforms (WPF, Avalonia, MAUI, WinUI)\n#if UI_TESTING\n    public SomeChartType Chart => chartNamedInXaml;\n#endif\n\n// EtoForms / WinForms\npublic SomeChartType Chart;  // public field, always present\n```\n\n**Blazor** exposes the chart via `@ref`:\n```razor\n<CartesianChart @ref=\"Chart\" .../>\n@code { public CartesianChart Chart; }\n```\n\n## Code Style and Conventions\n\n### Editor Config\nThe repository uses `.editorconfig` based on [.NET Runtime coding style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) with exceptions.\n\n**Key Style Rules:**\n- **Indentation**: 4 spaces\n- **Line endings**: LF, insert final newline\n- **Braces**: New line before open brace (Allman style)\n- **var usage**: Use `var` freely (explicitly allowed)\n- **Single-line if**: Allowed and preferred when line is short\n- **Naming**:\n  - Private/internal fields: `_camelCase`\n  - Static private fields: `s_camelCase`\n  - Constants: `PascalCase`\n- **Using directives**: Outside namespace\n\n### File Naming\n**Critical for auto-generated documentation:**\n- File names MUST match the class name exactly\n- `public class Hello` → `Hello.cs`\n- `public class Hello<T>` → `Hello.cs` (ignore generics)\n- Generic and non-generic with same name → same file (only if inheritance relationship)\n\n### Important Constants\nDefined in `Directory.Build.props`:\n- `LiveChartsVersion`: Current version (2.0.0-rc6.1)\n- `MinSkiaSharpVersion`: 2.88.9\n- `LatestSkiaSharpVersion`: 3.119.0\n- `LangVersion`: 14.0 (C# 14)\n\n## Build Configuration Properties\n\n### Rendering Settings\nRendering settings are configured via MSBuild properties:\n- `GPU`: Enable/disable GPU acceleration\n- `VSYNC`: Enable/disable vertical sync\n- `FPS`: Frame rate (10, 20, 30, 45, 60, 75, 90, 120)\n- `Diagnose`: Enable diagnostic mode\n\nThese create conditional compilation symbols for testing different rendering modes.\n\n### Development Flags\nIn `Directory.Build.props`:\n- `UseNuGetForSamples`: Use NuGet packages vs project references (default: false)\n- `UseNuGetForGenerator`: Use NuGet generator package (default: true)\n\n## CI/CD\n\n### GitHub Actions Workflows\n\n#### 1. Main CI (`livecharts.yml`)\n- Triggers: Pull requests\n- Runs on: `windows-2025` (pack/test), `ubuntu-24.04` (Linux/browser), `macos-26` (Mac/iOS)\n- Steps:\n  1. **Pack**: Builds NuGet packages for all platform libraries (core, skiasharp, WPF, Avalonia, MAUI, Blazor, WinUI, UNO, WinForms, Eto)\n  2. **test-core**: Runs `CoreTests` on `net8.0` and `net462`\n  3. **test-snapshot**: Runs `SnapshotTests`\n  4. **test-windows/linux/mac/browser/android/ios**: Runs Factos UI tests for each platform\n- On tag pushes (after tests pass): publishes packages to NuGet.org\n\n#### 2. Publish (`publish.yml`)\n- Handles NuGet package publishing\n\n**Note**: The CI uses NuGet packages (not project references) when running UI tests in Release mode.\n\n## Common Development Workflows\n\n### Adding a New Series Type\n1. Create series class in `src/LiveChartsCore/[SeriesType]/`\n2. Implement series interfaces (`ISeries`, etc.)\n3. Create SkiaSharp drawable in `src/skiasharp/LiveChartsCore.SkiaSharp/Drawing/Geometries/`\n4. Add tests in `tests/CoreTests/SeriesTests/`\n5. Create sample ViewModel in `samples/ViewModelsSamples/`\n6. Update `samples/ViewModelsSamples/Index.cs`\n\n### Adding Platform Support\n1. Create new project in `src/skiasharp/LiveChartsCore.SkiaSharpView.[Platform]/`\n2. Reference `LiveChartsCore.SkiaSharp` project\n3. Create platform-specific control classes\n4. Add shared code to `_Shared/` if applicable\n5. Create sample application in `samples/[Platform]Sample/`\n6. Add platform-specific solution file\n\n### Updating Documentation\n\n**Important**: Documentation files in the `docs/` folder are **Scriban templates**, not final markdown files.\n\n**How it works:**\n1. Template files are compiled by an external (non-open-source) repository\n2. Templates use [Scriban](https://github.com/scriban/scriban) - a fast, powerful, and lightweight text templating language\n3. Scriban supports custom functions and expressions embedded in the markdown\n\n**Common Scriban expressions you'll find:**\n\n**File inclusion** - Renders content from source files:\n```\n{{~ render \"~/../samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs\" ~}}\n{{~ render \"~/../samples/MauiSample/MauiProgram.cs\" ~}}\n{{~ render \"~/../samples/{samples_folder}/Events/Cartesian{view_extension}\" ~}}\n```\n\n**Conditionals** - Platform-specific content:\n```\n{{~ if xaml ~}}\n  Content for XAML platforms (WPF, Avalonia, UNO, WinUI, MAUI)\n{{~ end ~}}\n\n{{~ if winforms ~}}\n  Content specific to WinForms\n{{~ end ~}}\n```\n\n**Variables** - Dynamic content:\n```\n{{ website_url }}/docs/{{ platform }}/{{ version }}/About\n{{ assets_url }}/docs/{{ unique_name }}/result.gif\n{{ name | to_title_case }}\n{{ edit_source | replace_local_to_server }}\n```\n\n**Loops** - Iterate over collections:\n```\n{{~ for r in related_to ~}}\n  <a href=\"{{ compile this r.url }}\">{{ r.name }}</a>\n{{~ end ~}}\n```\n\n**Template structure:**\n- `docs/samples/[category]/[name]/template.md` - Sample documentation templates\n- `docs/shared/*.md` - Reusable template fragments included via `{{ render \"~/shared/...\" }}`\n- `docs/piechart/`, `docs/cartesianChart/`, etc. - Feature documentation with templates\n\n**When editing docs:**\n- Always edit the `.md` files as Scriban templates\n- Test template syntax (though final compilation happens externally)\n- Use `{{~ ~}}` syntax to strip whitespace around expressions\n- File paths in `render` are relative to the template location (use `~/../` for repo root)\n\n## Important Notes for Coding Agents\n\n### Do's\n- ✅ Use project references during development (not NuGet packages)\n- ✅ Follow the exact file naming convention (critical for docs)\n- ✅ Run tests after changes to core or series logic\n- ✅ Use platform-specific solution files for focused development\n- ✅ Consult `CONTRIBUTING.md` for detailed style guide\n- ✅ Use shared code in `_Shared/` folders when adding cross-platform features\n\n### Don'ts\n- ❌ Don't break multi-platform support when modifying core projects\n- ❌ Don't add platform-specific code to `LiveChartsCore` (keep it agnostic)\n- ❌ Don't ignore `.editorconfig` warnings\n- ❌ Don't remove or modify working tests without good reason\n- ❌ Don't add new dependencies without checking compatibility across all target frameworks\n\n### Special Considerations\n- The library supports .NET Framework 4.6.2 - maintain compatibility\n- SkiaSharp is abstracted - core library should work with other rendering engines\n- Animation system (`Motion/`) is critical - changes require extensive testing\n- Multi-threading: Chart updates can come from any thread; proper synchronization is essential\n\n## Quick Reference Commands\n\n```bash\n# === Building ===\n# Build core library (no workloads needed)\ndotnet build src/LiveChartsCore/LiveChartsCore.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj\n\n# Build platform-specific projects\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# === Install Workloads (for platform-specific projects) ===\ndotnet workload install maui --skip-sign-check\ndotnet workload install wasm-tools --skip-sign-check\n\n# Check installed workloads\ndotnet workload list\n\n# === Testing ===\n# Run core unit tests\ndotnet test tests/CoreTests/ --framework net8.0\n\n# Run snapshot tests\ndotnet test tests/SnapshotTests/\n\n# Run UI tests (requires sample apps to build)\ndotnet run --project tests/UITests/\n\n# Run UI tests for specific platform\ndotnet run --project tests/UITests/ -- --select wpf\ndotnet run --project tests/UITests/ -- --select avalonia-desktop\n\n# === Running Samples ===\n# Run WPF sample\ndotnet run --project samples/WPFSample/WPFSample.csproj\n\n# Run Avalonia sample\ndotnet run --project samples/AvaloniaSample/AvaloniaSample.csproj\n\n# Run Console sample (no UI)\ndotnet run --project samples/ConsoleSample/ConsoleSample.csproj\n\n# === Troubleshooting ===\n# Clean build artifacts\ndotnet clean\nfind . -type d -name \"bin\" -o -name \"obj\" | xargs rm -rf\n\n# Restore packages\ndotnet restore\n\n# Check for workload issues\ndotnet workload restore --skip-sign-check\n```\n\n## Documented Errors and Workarounds\n\nThis section documents actual errors encountered when working with this repository and their solutions.\n\n### Error 1: NETSDK1147 - Missing Workloads\n\n**Error Message:**\n```\nerror NETSDK1147: To build this project, the following workloads must be installed: maui\nTo install these workloads, run the following command: dotnet workload restore\n```\n\n**Context**: This occurs when building platform-specific view projects (MAUI, UNO, Avalonia Browser) that require specific workloads. Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) do NOT require any workloads.\n\n**Workarounds:**\n\n**Option 1: Install Required Workloads**\n```bash\ndotnet workload install maui --skip-sign-check\ndotnet workload install wasm-tools --skip-sign-check\n```\n\n**Option 2: Build Platform-Specific Projects that don't need workloads**\n```bash\n# Build only WPF (Windows only)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.WPF/LiveChartsCore.SkiaSharpView.Wpf.csproj\n\n# Build only Avalonia desktop (cross-platform)\ndotnet build src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj\n\n# Use platform-specific solution files\ndotnet build LiveCharts.WPF.slnx\n```\n\n### Error 2: Visual Studio Component Required\n\n**Error Message:**\n```\nUnhandled exception: The imported file \"$(MSBuildExtensionsPath32)/Microsoft/VisualStudio/v$(VisualStudioVersion)/CodeSharing/Microsoft.CodeSharing.Common.Default.props\" does not exist and appears to be part of a Visual Studio component.\n```\n\n**Context**: Appears when running `dotnet workload restore` on non-Windows systems or when Visual Studio is not installed.\n\n**Why it happens**: The `src/skiasharp/_Shared.WinUI/_Shared.WinUI.shproj` shared project requires Visual Studio components that are Windows-specific.\n\n**Workaround**: This error can be ignored if you're not building WinUI projects. The workload installation succeeds despite this error. If you need to build WinUI:\n- Use Windows with Visual Studio 2022 installed\n- Use `msbuild` instead of `dotnet build` for WinUI projects\n\n### Error 3: Ambiguous Argument with Git\n\n**Error Message:**\n```\nfatal: ambiguous argument 'origin/branch-name': unknown revision or path not in the working tree.\n```\n\n**Context**: After fetching a branch with `git fetch origin branch-name`, trying to reference it as `origin/branch-name`.\n\n**Why it happens**: Git fetch stores the ref as `FETCH_HEAD`, not as a trackable remote branch.\n\n**Solution**: Use `FETCH_HEAD` or create a local tracking branch:\n```bash\n# Option 1: Use FETCH_HEAD directly\ngit log FETCH_HEAD\n\n# Option 2: Create tracking branch\ngit fetch origin main\ngit checkout -b main --track origin/main\n\n# Option 3: Fetch with branch creation\ngit fetch origin main:main\n```\n\n### Error 4: Package Not Found During Build\n\n**Context**: Sample applications may fail to build if NuGet packages are not found.\n\n**Why it happens**: `UseNuGetForSamples` flag in `Directory.Build.props` controls whether samples use project references or NuGet packages.\n\n**Solution**: Ensure you're using project references during development:\n```xml\n<!-- In Directory.Build.props -->\n<UseNuGetForSamples>false</UseNuGetForSamples>\n```\n\nOr restore NuGet packages if building from packages:\n```bash\ndotnet restore\n```\n\n### Error 5: Strong Name Assembly Conflicts\n\n**Context**: When building for .NET Framework 4.6.2, you may encounter assembly version conflicts.\n\n**Why it happens**: .NET Framework uses strong-named assemblies, and SkiaSharp has different versioning.\n\n**Referenced Issue**: https://github.com/mono/SkiaSharp/issues/3153\n\n**Solution**: The project is configured to handle this, but if you encounter issues:\n1. Clean the solution: `dotnet clean`\n2. Delete `bin` and `obj` folders\n3. Restore and rebuild: `dotnet restore && dotnet build`\n\n### Error 6: Test Build Failures on CI\n\n**Context**: UI tests may fail with target framework mismatches in CI.\n\n**Solution**: The UI test infrastructure uses special MSBuild properties:\n- `TestBuildTargetFramework`: Override target framework for test builds\n- `IsTestBuild`: Flag to indicate test build\n- `UITesting`: Flag to include shared UI tests\n\nExample from `tests/UITests/Program.cs`:\n```csharp\nMSBuildArg tf_n10w = new(\"TestBuildTargetFramework\", \"net10.0-windows\");\nMSBuildArg isTest = new(\"IsTestBuild\", \"true\");\n```\n\n## Troubleshooting\n\n### Problem: Can't build platform-specific projects - workload errors\n**Solution**: Install the required workload for the platform you're targeting (e.g., `dotnet workload install maui`). Core projects (`LiveChartsCore`, `LiveChartsCore.SkiaSharp`) build without any workloads.\n\n### Problem: SkiaSharp errors\n**Solution**: Check SkiaSharp version in `Directory.Build.props`, ensure NuGet restore succeeded\n\n### Problem: Tests fail with animation issues\n**Solution**: Verify `CoreMotionCanvas.IsTesting = true` in test initialization\n\n### Problem: Sample won't run\n**Solution**: Ensure platform-specific dependencies are installed (e.g., .NET Desktop Runtime for WPF)\n\n### Problem: Generator errors\n**Solution**: Check `UseNuGetForGenerator` setting and ensure LiveChartsGenerators package/project is available\n\n## Issue Reproduction & Fix Workflow\n\nWhen picking up a GitHub issue (reproduce → diagnose → fix → regression test → PR),\nfollow the canonical workflow at [`.claude/skills/repro-and-fix/SKILL.md`](../.claude/skills/repro-and-fix/SKILL.md).\nThat doc is the single source of truth for both Claude Code and Copilot Coding Agent —\nkeep edits there, not duplicated here.\n\nQuick reference for the dev-loop hooks the workflow relies on:\n\n- **`LVC_SAMPLE=<sample-path>`** — XAML samples (Avalonia / WPF / WinUI / MAUI / Uno) auto-navigate to the named sample on launch, e.g. `LVC_SAMPLE=VisualTest/Issue1986Repro`. Skips manual UI navigation for repros.\n- **`LVC_SCREENSHOT=<png-path>`** — Avalonia / WPF / WinUI samples render the main window to PNG via `RenderTargetBitmap` shortly after activation and exit. Captures scale to physical pixels on HiDPI.\n- **`LVC_SCREENSHOT_DELAY_MS=<ms>`** — overrides the 3 s default settle delay before the in-app screenshot is taken (use on slower CI hosts).\n- **`.claude/scripts/capture-window.{ps1,-macos.sh,-linux.sh}`** — per-OS PrintWindow / `screencapture` / `grim` fallbacks for platforms without an in-app capture path (MAUI, Uno).\n\nRepro views live under `samples/AvaloniaSample/VisualTest/Issue<N>Repro/` (or\nthe equivalent under whichever platform sample fits the bug). Their code-behind\nexposes helpers (e.g. `FindTemplatedGaugeSeries()`) that Factos UI tests call\ndirectly. Factos and `LVC_SAMPLE` navigate by path and don't need the repro\nregistered in `samples/ViewModelsSamples/Index.cs` — **do not commit changes\nto that file for a repro view.** It's shared across every platform sample,\nso a single-platform repro entry will crash the load on the other platforms.\n\n## Resources\n\n- **Main Documentation**: https://livecharts.dev\n- **Contributing Guide**: `CONTRIBUTING.md`\n- **Repository**: https://github.com/Live-Charts/LiveCharts2\n- **Code of Conduct**: `CODE_OF_CONDUCT.md`\n- **License**: MIT (see `LICENSE`)\n\n## Version Information\n\n- **Current Version**: 2.0.0-rc6.1 (Release Candidate)\n- **C# Language Version**: 14.0\n- **SkiaSharp**: 2.88.9 (min) to 3.119.0 (latest)\n- **Target Frameworks**: `net462`, `netstandard2.0`, `net8.0`, `net8.0-windows` (core); plus platform-specific targets for view projects\n","category":".github","tokens":7669}]}