Skip to content

Charts

Strongly typed Blazor chart wrappers powered by Apache ECharts.

What the wrapper provides

ShardUI Charts brings Apache ECharts into Razor with typed data selectors, composable option components, accessible chart hosts, and a managed JavaScript lifecycle. You work with C# records and normal Blazor state while the wrapper creates, updates, resizes, and disposes the underlying chart instance.

Current Apache ECharts version 6.1.0

Architecture at a glance

1 · Data

Items<TItem> stays in your Blazor component.

2 · Host

A typed chart root owns one retained ECharts instance.

3 · Options

Zero-DOM child components contribute axes, tools, and series.

4 · Render

A versioned module draws Canvas or SVG and handles cleanup.

Typed values override the JSON-compatible native option escape hatch. JavaScript source strings are not evaluated; use the typed options, formatter templates, and Blazor event callbacks whenever possible.

How to use it

  1. Choose a host. Start with the visual family that answers the question: Line, Bar, Pie, Scatter, or another chart type.
  2. Pass typed data. Set TItem and Items, then map record properties with series selectors.
  3. Compose options. Add zero-DOM children such as axes, tooltip, legend, data zoom, and one or more series.
  4. Make the result understandable. Add a name, description, equivalent data, ECharts ARIA labels, and an explicit Tailwind height.

Typed ECharts options

The wrapper models the JSON-safe, non-GL Apache ECharts 6.1 option surface in C#: global components, coordinate systems, series states and styles, datasets and encodings, brush and timeline configuration, graphics, responsive media, transitions, toolbox features, and initialization settings. Union values such as "auto", numeric IDs, custom line dashes, modifier-key gestures, and scalar-or-array options have dedicated C# value types with implicit conversions.

JavaScript callbacks, browser runtime objects, external coordinate-system extensions, and WebGL series are intentionally outside this release. ChartNativeOptions remains a forward-compatible escape hatch for a new upstream JSON property; it does not evaluate JavaScript and typed values win on conflicts.

Accessibility first

The Apache ECharts handbook describes the accessibility goal below. Its reference to ECharts 4.0 marks the version that introduced ARIA support; ShardUI currently targets Apache ECharts 6.1.0.

When thinking about a visualization, we naturally associate it with what you see, but there are other dimensions to viewing. The W3C has developed the Accessible Rich Internet Applications Suite (WAI-ARIA), which aims to make web content and web applications accessible to more people with disabilities.

ECharts 4.0 complies with this specification and supports automatic generation of descriptions based on chart configuration items, enabling people with visual disabilities to understand the chart content with screenreaders, so that charts are accessible to all.

A visual chart is not a complete accessible experience by itself. Name the figure with AccessibleName or AriaLabelledBy, summarize the insight with AccessibleDescription, and provide the same values through AccessibleContent or an external table referenced by AriaDescribedBy. ChartAria adds ECharts' detailed data description and decal patterns, while the default motion policy follows the user's reduced-motion preference.

ECharts does not make pointer interactions keyboard accessible automatically. If a chart filters, selects, or drills into data, provide equivalent native controls and expose the resulting state in text. Do not rely on color alone: combine labels, symbols, or decal patterns and verify contrast in every theme.

Common application charts

These four families cover many dashboards and line-of-business applications. Open a guide for the full typed API and more specialized examples.

Line · trends over time

Track change, direction, and seasonality.

Guide

Revenue rose from 48 in March to 81 in August, with a small decline in May.

Revenue values shown in the chart
MonthRevenue
Mar48
Apr57
May54
Jun68
Jul73
Aug81

Bar · category comparison

Compare values across teams or products.

Guide

Pie · part-to-whole

Show a small set of meaningful proportions.

Guide

Scatter · relationships

Reveal clusters, outliers, and correlation.

Guide
An unhandled error has occurred. Reload 🗙

    Rejoining the server...

    Rejoin failed... trying again in seconds.

    Failed to rejoin.
    Please retry or reload the page.

    The session has been paused by the server.

    Failed to resume the session.
    Please reload the page.