Dashboards your users configure
Let users build their own dashboards: each chart is a small JSON definition that names a dataset and its fields. Store it per user, draw
it with <RioChart Definition="..." />, and let people change it in a form, as JSON, or by asking an AI agent. The data
and who may see it stay in your app.
A definition holds no data and no code: only names, types and options, checked when it is read, with errors that say what is wrong. That makes it safe to save what users write, and every RioCharts 1.x reads the definitions saved today. The same definition renders in Blazor, to PNG or SVG on the server, and through the AI tools.
Try the editor
Four tiles from saved definitions. Edit opens the editor: pick what to show and a chart, fill in the data it needs, then fine-tune. Add chart starts a new tile, Use your own data starts one from a file of yours, and What is saved shows what your app would store: one JSON definition per tile, nothing else.
Use your own data
A CSV file with a header row, or a JSON array of objects. It is read here, in your browser, and never sent anywhere; usage statistics stop once you open this (see Privacy). It is gone when you leave the page.
Or paste CSV or JSON
The data on this page
Online store traffic per sales channel (Web, App, Marketplace), hourly for one week. Passed in from C# with Datasets="datasets".
504 rows, 6 fields
timestamp time | channel text | sessions number | orders number | revenue number | responseMs number |
|---|---|---|---|---|---|
| 2026-11-14 00:00 | Web | 778 | 18 | 1283 | 175 |
| 2026-11-18 04:00 | Web | 298 | 7 | 577 | 165 |
| 2026-11-15 09:00 | App | 89 | 2 | 166 | 131 |
| 2026-11-19 14:00 | App | 367 | 9 | 742 | 154 |
| 2026-11-16 19:00 | Marketplace | 352 | 8 | 651 | 169 |
5 of 504 rows, spread over the dataset.
What is saved
[
{
"version": 1,
"title": "Orders per day",
"series": [
{
"type": "bar",
"x": "timestamp",
"y": "orders",
"timeBucket": "day",
"aggregate": "sum",
"groupBy": "channel",
"stack": "channels"
}
],
"dataset": "shop"
},
{
"version": 1,
"title": "Revenue per category (k€)",
"horizontal": true,
"series": [
{
"type": "bar",
"x": "category",
"y": "revenue",
"aggregate": "sum",
"sort": "descending"
}
],
"dataset": "sales"
},
{
"version": 1,
"title": "Revenue per channel",
"series": [
{
"type": "pie",
"x": "channel",
"y": "revenue",
"aggregate": "sum",
"innerRadius": 0.6,
"format": "#,0 €"
}
],
"dataset": "shop"
},
{
"version": 1,
"title": "Response time",
"y": {
"title": "ms"
},
"series": [
{
"x": "timestamp",
"y": "responseMs",
"timeBucket": "hour",
"aggregate": "average",
"name": "Average"
}
],
"annotations": [
{
"value": 200,
"label": "Goal"
}
],
"dataset": "shop"
}
]Save and load definitions
ChartDefinitionJson.Serialize writes a definition as a short JSON string with "version": 1; keep it per user and
tile, in whatever store you use. ChartDefinitionJson.Parse reads it back. It is tolerant (synonyms such as
column or doughnut, comments, trailing commas) and returns errors with the path to the problem instead of
throwing, so one broken tile never takes the dashboard down.
// Save: a short JSON string per tile.
string json = ChartDefinitionJson.Serialize(definition);
await tiles.SaveAsync(userId, tileId, json);
// Load: never throws; each error names the path to the problem (e.g. series[0].type) and what is valid.
var parsed = ChartDefinitionJson.Parse(await tiles.LoadAsync(userId, tileId));
if (!parsed.Success)
{
ShowProblem(parsed.Errors);
}Saved definitions keep working: every 1.x release reads version 1 definitions, and fields, chart types and words may be added but are never removed or changed in meaning (see saved definitions keep working). A definition from a newer version is still drawn, with a warning, without the fields this version does not know.
Give each user their data
A definition refers to data only by name: a dataset and its fields. Your app decides what a name means for this user. Implement
IChartDataSource: Describe lists the datasets a user may chart (names, fields and descriptions, for field
pickers and AI agents), and LoadAsync loads one when a definition asks for it. Return null for a name that does not exist
or that this user may not see; the chart then says the dataset was not found.
public sealed class ShopData(IOrderRepository orders, ICurrentUser user) : IChartDataSource
{
// What this user may chart: names, fields and descriptions; no values needed here.
public IReadOnlyList<ChartDataset> Describe() => user.CanSeeOrders
? [new ChartDataset("orders",
[
new DataField("timestamp", FieldType.Time, []),
new DataField("channel", FieldType.Text, [], "Web, App or Marketplace"),
new DataField("orders", FieldType.Number, []),
],
"Orders per hour and sales channel")]
: [];
public async Task<ChartDataset?> LoadAsync(string name, CancellationToken ct = default) => name switch
{
"orders" when user.CanSeeOrders => ChartDataset.FromItems("orders",
await orders.PerHourAsync(user.StoreId, ct), "Orders per hour and sales channel"),
_ => null, // unknown, or not for this user
};
}
Then load what a tile needs and draw it. DefinitionErrors on the chart lists binding problems (a field that is not in the
dataset, a text field used as a value), and the chart shows them in place of the plot.
<RioChart TItem="object" Definition="tile.Definition" Datasets="tile.Datasets" Height="240" />
@code {
// Load the datasets the definition names (the chart's and each series' own).
async Task LoadAsync(Tile tile)
{
var names = tile.Definition.Series.Select(s => s.Dataset ?? tile.Definition.Dataset)
.OfType<string>().Distinct(StringComparer.OrdinalIgnoreCase);
var datasets = new Dictionary<string, ChartDataset>(StringComparer.OrdinalIgnoreCase);
foreach (var name in names)
{
if (await data.LoadAsync(name) is { } dataset)
{
datasets[name] = dataset;
}
}
tile.Datasets = datasets;
}
}Let users edit
- A form.
ChartDefinitionJson.Schema()is the JSON schema of a definition, with a description of every option, its type and the allowed words. Build your own form from it in your design system; the editor on this page is one (its source is in samples/RioCharts.Docs/Editor; copy it as a start). A ready-made editor component is planned after 1.0. - JSON. For power users and admins: the format is small and readable, and the parse errors say what to fix.
- An AI agent. "Make it a stacked bar per channel":
ChartToolgives a model the create_chart tool with your datasets, and the result is the same definition, validated, to save in the tile. See AI agents and MCP.
Safe to store what users write
A definition is data, never code: there are no expressions or scripts, and field names are only looked up in the datasets you load. The parser caps what one definition can ask for (at most 20 series, 50 annotations and 1000 inline rows), and text from a definition is escaped wherever it is drawn. Check sizes as you would for any user input before you store it.
More for dashboards
- Many charts on a page:
Interactive="false"draws plain SVG with no JS (see compact charts), andCompact="true"makes KPI tiles and sparklines. - Linked tiles: charts with the same
Groupshare the crosshair and, when zoomable, the zoom, for tiles over the same time range. - Reports by email: bind the same definition on the server and export it, with
ChartExport.ToPng(see server-side export). - Theme and language: tiles follow the app's theme and the user's culture; nothing about either is stored in the definition.
// The same saved tile as a PNG for a weekly email (RioCharts.Skia).
var definition = ChartDefinitionJson.Parse(json).Definition!;
var bound = await ChartDefinitionBinder.BindAsync(definition, new ShopData(orders, user));
byte[] png = ChartExport.ToPng(bound.Definition, bound.Data, new ExportOptions { Width = 640, Height = 320 });