Coming from Blazor-ApexCharts
Moving from Blazor-ApexCharts to RioCharts? Both libraries have the same creator, and most of it will feel familiar: items with XValue and YValue
selectors, YAggregate, series as child components. This page maps the main concepts.
The main difference
Blazor-ApexCharts wraps the ApexCharts JavaScript library: your options go to JavaScript, which lays out and draws the chart.
RioCharts lays out the chart in .NET and renders SVG through Blazor; a small JS module only measures text and handles the pointer.
So there is no options object to send: the chart is configured with typed parameters, a change to a parameter or to
Items draws the chart again, and the same layout renders on the server (PNG/SVG export) and from JSON definitions.
Side by side
Order value per country, summed, as bars.
@* Blazor-ApexCharts *@
<ApexChart TItem="Order" Title="Order value">
<ApexPointSeries TItem="Order" Items="orders" Name="Value" SeriesType="SeriesType.Bar"
XValue="o => o.Country" YAggregate="g => g.Sum(o => o.Value)" />
</ApexChart>@* RioCharts *@
<RioChart TItem="Order" Items="orders" Title="Order value">
<BarSeries Name="Value" XValue="o => o.Country" YAggregate="g => g.Sum(o => o.Value)" />
</RioChart>Concepts
| Blazor-ApexCharts | RioCharts |
|---|---|
AddApexCharts(o => o.GlobalOptions = ...), IApexChartService | Optional: builder.Services.AddRioCharts(new RioChartDefaults { Culture = ..., Height = ... }) for app-wide defaults; a cascaded RioChartDefaults for part of the app, or to change them at runtime (the charts follow). Theme switches need no call: colors follow the page's theme. See Getting started. |
<ApexChart TItem Title Height> | <RioChart TItem Title Height>; the width follows the container. |
<ApexPointSeries SeriesType="SeriesType.Bar"> | One component per type: LineSeries, AreaSeries, BarSeries, ScatterSeries, PieSeries, DonutSeries, RadialBarSeries, RadarSeries, HeatmapSeries, TreemapSeries. |
XValue, YValue, YAggregate | The same names. Common aggregates also as Aggregate="Aggregate.Sum" (Average, Min, Max, Count, Last). |
OrderBy, OrderByDescending | Sort Items with LINQ; categories keep the order of the items. |
PointColor | ColorValue, plus ColorBands to color by value (a line turns red above a limit). |
| Data labels in the options | DataLabels="true" on the series. |
| Range, candle and box plot series | RangeAreaSeries (LowValue and YValue), CandlestickSeries (OpenValue, HighValue, LowValue, CloseValue, or raw readings with Bucket), BoxPlotSeries (raw values, or Q1Value, MedianValue, ...). |
| X and y axis options, several y axes | XAxis, YAxis and YAxes (AxisOptions), and YAxisId on the series. |
| Annotations in the options | Child components: ReferenceLine, ReferenceBand, PointAnnotation, Callout; a reference line can be dragged (@bind-Value). |
| Curve in the stroke options | Curve="CurveType.Monotone" (or Step) on the series. |
| Stacking in the chart options | Stack="name" on each series to stack; Stacking = StackMode.Percent on the y axis for 100 % stacked. |
ApexChartOptions plus the series, built in code | A chart definition (ChartDefinition): the whole chart in one object, series and their fields included, passed as <RioChart Definition>. Its parts are options: AxisOptions, SeriesOptions, LegendOptions, TooltipOptions. |
| Tooltip options, custom tooltip | Tooltip (TooltipOptions), TooltipValue per series, or a TooltipTemplate with your own Razor. |
| Chart group (synced charts) | Group="name": shared crosshair and zoom, and the plots line up. |
| Zoom and the toolbar | Zoomable="true" (drag, pinch, Ctrl+wheel, keyboard), Exportable="true" for PNG, SVG and CSV downloads. |
| Colors and theme mode | CSS variables (--rio-series-1 ... , --rio-text, ...); light and dark follow the page. See Theming. |
| Animations | None: RioCharts does not animate charts. Bars don't grow, lines don't draw on, and updates are drawn in place. The only motion is a short fade when the series first appear (Animate="false" turns it off). See Motion. |
| Data point selection event | OnPointClick, or Selection="ChartSelectionMode.Points" with @bind-SelectedItems (and ChartSelectionMode.Range). |
| Legend click event | OnLegendClick, and OnLegendClicking to cancel. |
| Zoomed event | @bind-VisibleRange or OnZoomChanging. |
| Updating series, rendering again | Not needed: pass a new Items list, or change DataVersion after changing a list in place. For live data, append to a SeriesBuffer. |
| Zooming, showing and hiding series from code | ZoomToAsync, ResetZoomAsync, ShowSeriesAsync, HideSeriesAsync, ToggleSeriesAsync, HighlightSeriesAsync. |
What else is different
- Series render nothing themselves; the chart lays them out together. Selectors run once per data change, not per render.
- Large data is downsampled (LTTB) and can draw on a canvas layer (
SeriesLayer="SeriesLayer.Canvas"); see Large data. - The same chart renders without a browser: server-side export to SVG and PNG, and static SSR as plain SVG.
- A chart definition can also be written as JSON, which is how AI agents create charts; see Chart definitions.
- The chart's own texts (empty states, screen reader texts) come in eight languages; see Languages and texts.