$npx -y skills add DevExpress/agent-skills --skill devexpress-winforms-chartsDevExpress WinForms Chart Control (DevExpress.XtraCharts.ChartControl) for 2D and 3D data visualization. Covers the element hierarchy (ChartControl, Diagram, Series, SeriesView); data binding (DataSource, SeriesDataMember, ArgumentDataMember, ValueDataMembers, SeriesTemplate, Fin
| 1 | # DevExpress WinForms Chart Control |
| 2 | |
| 3 | `DevExpress.XtraCharts.ChartControl` is a 2D and 3D data-visualization component that supports 50+ series view types (bar, line, area, pie, financial, radar, polar, funnel, gantt, swift plot for huge datasets, etc.). The architecture is a four-level hierarchy: a `ChartControl` hosts a single `Diagram` of a specific type (`XYDiagram`, `SimpleDiagram`, `GanttDiagram`, `RadarDiagram`, `PolarDiagram`, `SwiftPlotDiagram`, or their 3D counterparts), the diagram contains a collection of `Series`, and each `Series` has a `View` (`BarSeriesView`, `LineSeriesView`, `PieSeriesView`, …) that determines its appearance. The diagram type is implicitly chosen by the first added series' view — adding a `Series` of `ViewType.Pie` produces a `SimpleDiagram` automatically; adding `ViewType.Bar` produces an `XYDiagram`. |
| 4 | |
| 5 | Every chart concept — series, axis, label, legend, tooltip, crosshair, selection — exposes a consistent property model and a `CustomDraw*` event for cases the property model cannot cover. The same `Series` API works for bound and unbound modes: assign `DataSource` + `ArgumentDataMember` + `ValueDataMembers` for data binding, or `Points.Add(new SeriesPoint(...))` for inline values. |
| 6 | |
| 7 | ## When to Use This Skill |
| 8 | |
| 9 | - Adding a chart to a WinForms app — pick a series view, bind data, configure axes. |
| 10 | - Choosing the right series view for the data shape (bar comparison vs trend line vs pie share vs financial OHLC vs radar profile vs gantt timeline). |
| 11 | - Configuring axes (primary + secondary; Numerical / DateTime / TimeSpan / Qualitative scale types) and their ranges. |
| 12 | - Formatting axis titles and labels (`TextPattern` with `{A}`/`{V}`/`{VP}` placeholders + .NET format specifiers). |
| 13 | - Aggregating large data sets on a DateTime axis via `ScaleMode = Automatic` and `AggregateFunction`. |
| 14 | - Configuring the legend — single or multiple legends, alignment, layout, per-series legend item text via `LegendTextPattern`. |
| 15 | - Enabling tooltips and the crosshair cursor; formatting their content; understanding when each one is the default. |
| 16 | - Enabling selection (Single, Multiple, or Extended) and choosing whether the entire series, a single point, or all points with the same argument get selected. |
| 17 | |
| 18 | ## Prerequisites & Installation |
| 19 | |
| 20 | ### NuGet Packages |
| 21 | |
| 22 | | Package | Required For | |
| 23 | |---|---| |
| 24 | | `DevExpress.Win.Charts` | `ChartControl`, all series views, all diagrams. | |
| 25 | | `DevExpress.Win.Printing` | `ChartControl.ShowPrintPreview()`, `ExportToPdf`/`ExportToImage`/`ExportToXlsx` for charts. | |
| 26 | | `DevExpress.Win` *(umbrella, optional)* | Covers most WinForms controls including Charts. | |
| 27 | |
| 28 | ### Host Form |
| 29 | |
| 30 | `XtraForm` is recommended for skin propagation but not required — `ChartControl` works on a plain `Form`. The control is found under the `DX.<version>: Data & Analytics` Toolbox group (the version segment matches your installed DevExpress version). |
| 31 | |
| 32 | ### Common Imports |
| 33 | |
| 34 | ```csharp |
| 35 | using DevExpress.XtraCharts; |
| 36 | using DevExpress.Utils; // DefaultBoolean, BorderOptions |
| 37 | using DevExpress.XtraEditors; // XtraForm host |
| 38 | ``` |
| 39 | |
| 40 | For chart-specific repository items used in grids, also `using DevExpress.XtraEditors.Repository;` (`RepositoryItemAnyControl` to embed a chart in a grid cell). |
| 41 | |
| 42 | ## Before You Start — Ask the Developer |
| 43 | |
| 44 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time wi |