---
name: devexpress-blazor-gauges
description: Generate and configure DevExpress Blazor visualization components such as DxBarGauge, DxRangeSelector, DxSankey, DxSparkline, and DxMap. Use when building dashboards with gauges and range selection, Sankey flow diagrams, sparklines/mini charts, and interactive maps (data binding, labels, palettes, selection/hover/click events). Also use for bar gauge, range selector, Sankey, sparkline, map, and visualization feature comparisons or migration scenarios.
compatibility: Requires .NET 8+. NuGet package DevExpress.Blazor is available on NuGet.org. Interactive render mode required for Range Selector selection, Sankey/Map hover and click events. DxMap requires an API key from Azure, Google, or GoogleStatic GIS services.
metadata:
author: DevExpress
version: "26.1"
source-commit: 8493730c9e9a47a009fc307a37c307e157663819
---
# DevExpress Blazor Visualization Components
A collection of specialized visualization components for Blazor:
- **`DxBarGauge`** — Circular bar gauge displaying multiple values as arcs
- **`DxRangeSelector`** — Linear scale with draggable sliders for range selection; optionally displays a background chart
- **`DxSankey`** — Flow diagram showing value transfer between two entity sets
- **`DxSparkline`** — Compact trend line/bar embedded in other UI (e.g., inside a Grid column)
- **`DxMap`** — Geo map with markers and route display using Azure, Google, or GoogleStatic tiles
## When to Use This Skill
- Display multiple gauge values as concentric arc bars (`DxBarGauge`)
- Let users visually select a date/numeric range by dragging sliders (`DxRangeSelector`)
- Visualize flow between categories or entities (`DxSankey`)
- Embed a compact trend chart inside a Grid cell or card (`DxSparkline`)
- Show geo locations, routes, or markers on a map (`DxMap`)
- Export gauge/sparkline/sankey as PNG/PDF/JPEG/GIF
## Prerequisites & Installation
### NuGet Package
| Package | Purpose |
|---|---|
| `DevExpress.Blazor` | All components in this skill |
```bash
# Install from NuGet.org:
dotnet add package DevExpress.Blazor
```
Register in `Program.cs`:
```csharp
builder.Services.AddDevExpressBlazor();
```
> **v26.1 note**: `DevExpress.Blazor` no longer includes `options.BootstrapVersion` or `DevExpress.Blazor.BootstrapVersion`. Do not generate either API.
Add to `_Imports.razor`:
```razor
@using DevExpress.Blazor
```
Apply a theme and add client scripts in `App.razor` inside `
`:
```razor
@using DevExpress.Blazor
@DxResourceManager.RegisterTheme(Themes.Fluent)
@DxResourceManager.RegisterScripts()
```
**`DxMap` requires a GIS API key** (Azure Maps, Google Maps, or GoogleStatic). Pass it via the `DxMapApiKeys` child component and set `Provider`.
## Before You Start — Ask the Developer
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.
Before generating code, ask:
1. **Render mode**: `InteractiveServer`, `InteractiveWebAssembly`, `InteractiveAuto`, or Static/SSR? (Range Selector dragging and Map/Sankey click events require interactivity)
2. **Which component?**: Bar Gauge, Range Selector, Sankey, Sparkline, or Map?
3. **Data source**: Collection type and field names (for Sankey: source, target, weight fields; for Sparkline: argument, value fields)
4. **For Bar Gauge**: How many values? What is the scale range (`StartValue`/`EndValue`)?
5. **For Range Selector**: Numeric or DateTime scale? Does the user need a background chart?
**Does the selected range need to filter or drive other components?**
(If yes → use `ValueChanged` event with `RangeSelectorValueChangedEventArgs`; never use `@bind-SelectedRangeStartValue`.)
6. **For Map**: Which GIS provider? Do you have an API key?
## Component Overview
### DxBarGauge — Quick Pattern
```razor
@rendermode InteractiveServer
@code {
double[] Values = new double[] { 47.27, 65.32, 84.59 };
string[] Captions = new string[] { "Metacritic", "Rotten Tomatoes", "IMDb" };
}
```
### DxSankey — Quick Pattern
```razor
```
### DxSparkline — Quick Pattern
```razor
```
### DxRangeSelector — Quick Pattern
```razor
```
### DxMap — Quick Pattern
```razor
@rendermode InteractiveServer
```
> **Note**: `DxMap` requires a GIS provider API key. Use `MapProvider.GoogleStatic` for a quick static-image test without interactive tile setup.
## Documentation & Navigation Guide
### Bar Gauge
📄 [references/bar-gauge.md](references/bar-gauge.md)
When you need to: configure gauge geometry (start/end values, base value), labels, legend, tooltips, palette, or export.
### Range Selector
📄 [references/range-selector.md](references/range-selector.md)
When you need to: configure scale (type, tick intervals, min/max range), set a predefined selected range, display a background chart, or handle selection change events.
### Sankey
📄 [references/sankey.md](references/sankey.md)
When you need to: bind Sankey to data (source/target/weight fields), configure nodes/links/labels, handle click/hover events, or customize appearance.
### Sparkline
📄 [references/sparkline.md](references/sparkline.md)
When you need to: embed a sparkline in a Grid column, choose series type, configure min/max highlighting, win/loss display, or export.
### Map
📄 [references/map.md](references/map.md)
When you need to: display markers or routes on a geo map, set the GIS provider (Azure, Google, or GoogleStatic), configure the API key, handle marker click events, or customize map zoom and center.
### Getting Started (All Components)
📄 [references/getting-started.md](references/getting-started.md)
When you need to: install and configure the NuGet package, add CSS/imports, or set up the first component.
## Key Properties & API Surface
### DxBarGauge
| Property | Type | Description |
|---|---|---|
| `Values` | `double[]` | Array of values to display as gauge arcs |
| `StartValue` | `double` | Minimum scale value |
| `EndValue` | `double` | Maximum scale value |
| `BaseValue` | `double` | Base value for bars (bars grow from this value) |
| `Width` / `Height` | `string` | Component dimensions |
| `Palette` | `string[]` | Colors for each bar |
| `ExportAsync()` | `Task` | Export as base64 image |
### DxSankey
| Property | Type | Description |
|---|---|---|
| `Data` | `IEnumerable` | Data source |
| `SourceFieldName` | `string` | Field name for the flow source node |
| `TargetFieldName` | `string` | Field name for the flow target node |
| `WeightFieldName` | `string` | Field name for the flow weight/volume |
| `Width` / `Height` | `string` | Component dimensions |
### DxSparkline
| Property | Type | Description |
|---|---|---|
| `Data` | `IEnumerable` | Data source |
| `ArgumentFieldName` | `string` | Field name for argument values |
| `ValueFieldName` | `string` | Field name for data values |
| `Type` | `SparklineType` | Series type: `Line`, `Bar`, `Spline`, `SplineArea`, `Area`, `StepLine`, `StepArea`, `WinLoss` |
| `Width` / `Height` | `string` | Component dimensions |
### DxRangeSelector
| Property | Type | Description |
|---|---|---|
| `Data` | `IEnumerable` | Optional data source for background chart |
| `SelectedRangeStartValue` | `object` | Initial start of the selected range |
| `SelectedRangeEndValue` | `object` | Initial end of the selected range |
| `SelectedRangeLength` | `ChartAxisInterval` | Length of initial selected range |
| `ValueChanged` | `EventCallback` | Fires when the selected range changes. `args.CurrentRange` is a `List