$npx -y skills add DevExpress/agent-skills --skill devexpress-wpf-chartsBuild WPF applications with the DevExpress Chart Control (ChartControl) — 2D bar, line, area, pie, financial, polar, radar, funnel, box plot, point, bubble, and scatter series. Use when adding ChartControl to a WPF project; building XYDiagram2D, SimpleDiagram2D (pie/funnel), Pola
| 1 | # DevExpress WPF Chart Control |
| 2 | |
| 3 | `DevExpress.Xpf.Charts.ChartControl` is the 2D charting control for WPF applications. A chart is composed of a **Diagram** (which determines the coordinate system — Cartesian, polar, radar, simple), one or more **Series** (the actual data plots: bar, line, area, pie, financial, etc.), **Axes** for Cartesian-like diagrams, plus optional **Title**, **Legend**, **Annotations**, **Tooltip**, and **Crosshair Cursor**. Series bind to data through `DataSource` + `ArgumentDataMember` / `ValueDataMember`, with automatic scale-type detection and built-in aggregation. |
| 4 | |
| 5 | > **3D charting** uses a separate control (`Chart3DControl`) and is rarely needed. This skill covers `ChartControl` (2D). |
| 6 | |
| 7 | ## When to Use This Skill |
| 8 | |
| 9 | Use this skill when you need to: |
| 10 | |
| 11 | - Add a chart to a WPF window |
| 12 | - Bind a chart to an `IEnumerable` / `ObservableCollection` / `DataTable` |
| 13 | - Pick a series type (bar, line, area, pie, financial, point, bubble, polar, radar, funnel, box plot) |
| 14 | - Configure primary or secondary axes |
| 15 | - Pick an axis scale type (Numerical, DateTime, TimeSpan, Qualitative) |
| 16 | - Add axis titles, custom labels, format label text via patterns |
| 17 | - Aggregate data for performance or readability |
| 18 | - Add a legend, format legend items, enable check boxes for series visibility |
| 19 | - Show tooltips and the crosshair cursor; format their content |
| 20 | - Enable end-user selection (Single, Multiple, or Extended) |
| 21 | |
| 22 | ## Prerequisites & Installation |
| 23 | |
| 24 | ### NuGet Packages |
| 25 | |
| 26 | | Package | Purpose | |
| 27 | |---------|---------| |
| 28 | | `DevExpress.Wpf.Charts` | Main package — `ChartControl`, all 2D series, diagrams, axes | |
| 29 | | `DevExpress.Wpf.Printing` | Required for `ChartControl.PrintPreview()` and export | |
| 30 | |
| 31 | All DevExpress packages in a project must share the same version. |
| 32 | |
| 33 | ### .NET 8+ |
| 34 | |
| 35 | ```bash |
| 36 | dotnet add package DevExpress.Wpf.Charts |
| 37 | ``` |
| 38 | |
| 39 | Add to `.csproj`: |
| 40 | |
| 41 | ```xml |
| 42 | <PropertyGroup> |
| 43 | <TargetFramework>net8.0-windows</TargetFramework> |
| 44 | <UseWPF>true</UseWPF> |
| 45 | </PropertyGroup> |
| 46 | ``` |
| 47 | |
| 48 | ### Required References (when not using NuGet) |
| 49 | |
| 50 | - `DevExpress.Data.v<XX.X>.dll` |
| 51 | - `DevExpress.Xpf.Core.v<XX.X>.dll` |
| 52 | - `DevExpress.Charts.v<XX.X>.Core.dll` |
| 53 | - `DevExpress.Xpf.Charts.v<XX.X>.dll` |
| 54 | - `DevExpress.Mvvm.v<XX.X>.dll` |
| 55 | |
| 56 | A valid DevExpress license is required. |
| 57 | |
| 58 | ## Before You Start — Ask the Developer |
| 59 | |
| 60 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 61 | |
| 62 | 1. **Target framework**: .NET 8+ or .NET Framework 4.x? |
| 63 | 2. **Chart type**: What kind of data is being visualized? See [series-types.md](references/series-types.md) for the picker. Common starting points: |
| 64 | - Categories vs values → bar / column |
| 65 | - Continuous trend over time → line / area |
| 66 | - Composition of a whole → pie / donut |
| 67 | - Stock data (OHLC) → candlestick / stock |
| 68 | 3. **Data source**: `List<T>`, `ObservableCollection<T>`, `DataTable`, EF, or static XAML data? |
| 69 | 4. **Axes**: One value axis (most cases) or also a secondary y-axis (two series with very different ranges)? |
| 70 | 5. **Scale types**: Are arguments numeric, date-time, time-span, or category strings? See [axes.md](references/axes.md). |
| 71 | 6. **Aggregation**: Is the data large enough that you need to bucket / average it? See [data-aggregation.md](references/data-aggregation.md). |
| 72 | 7. **MVVM**: Are series defined declaratively in XAML or generated from a ViewModel collection? |
| 73 | |
| 74 | ## Component Overview |
| 75 | |
| 76 | ### XAML Namespace |
| 77 | |
| 78 | ```xml |
| 79 | xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" |
| 80 | ``` |
| 81 | |
| 82 | ### Element Hierarchy |
| 83 | |
| 84 | ``` |
| 85 | ChartControl |
| 86 | ├── ChartControl.Titles (one or more Title objects) |
| 87 | ├── ChartControl.Legends (one or more Legend objects) |
| 88 | ├── ChartControl.CrosshairOptions (CrosshairOptions) |
| 89 | ├── Ch |