Languages and texts

A chart writes a few texts of its own, in English, Swedish, Norwegian, Danish, Finnish, German, French or Spanish. They are "No data available", "Reset zoom", "Total" in a donut, the download button, and what screen readers hear (the chart description, axis names, keyboard help), and you can change any of them or add your own language.

From the culture

The texts follow the chart's Culture, or the current UI culture when it has none: sv-FI tries sv-FI, then sv, then falls back to English. Pick a language and zoom the line chart (drag in the plot), then hover the Reset zoom button for its text. The numbers follow the culture too.

Diagram med 1 serie. Revenue: 192 värden, lägst 42 € vid 2026-11-17 08:00, högst 1 709 € vid 2026-11-16 18:15, stabil trend. 00,5k1k1,5k2k16 nov.06:0012:0018:0017 nov.06:0012:0018:00Använd vänster- och högerpil för att flytta mellan punkter. Plus och minus zoomar, Skift med vänster- och högerpil panorerar, 0 visar all data. Tryck Escape för att lämna.
Ringdiagram med 6 poster: Shoes 412, Clothing 236, Camping 148, Accessories 97, Bags 31, Övrigt 15. ShoesClothingCampingAccessoriesBagsÖvrigt939 k€TotaltAnvänd piltangenterna för att flytta mellan delarna. Tryck Escape för att lämna.
Diagram med 1 serie. Inga data. Inga data
Code
Razor
<RioChart Items="revenue" Culture="@(new CultureInfo("sv-SE"))" Zoomable="true" Exportable="true">
    <LineSeries Name="Revenue" XValue="r => r.Time" YValue="r => r.Value" Format="#,0 €" />
</RioChart>

Changing texts

ChartTexts holds the texts. Change the ones you want with with; the rest stay as they are. Give it to one chart with Texts:

Razor
<RioChart Items="orders" Texts="@(ChartTexts.Swedish with { ResetZoom = "Visa allt", NoData = "Inga ordrar ännu" })">
    ...
</RioChart>

Or cascade it to every chart in the app. A cascaded value is per user, so it can follow each user's language. A Texts parameter still wins:

Razor
@* MainLayout.razor *@
<CascadingValue Value="_chartTexts">
    @Body
</CascadingValue>

@code {
    private readonly ChartTexts _chartTexts = ChartTexts.English with { NoData = "Waiting for the first order" };
}

Adding a language

Register a language once at startup and every chart with that culture uses it. A registered language takes precedence over a built-in one, so you can also replace the built-in Swedish with your own wording. Texts you leave out fall back to English.

C#
// Program.cs
ChartTexts.Register("pl", new ChartTexts
{
    Chart = "Wykres",
    NoData = "Brak danych",
    ResetZoom = "Resetuj powiększenie",
    Total = "Razem",
    Summary = "Wykres z {0} serią.|Wykres z {0} seriami.",
});

From resx files or IStringLocalizer

If your app already translates with resource files, ChartTexts.From reads the texts by key. The keys are the property names in the table below (also in ChartTexts.Keys). Keys your resources don't have keep the fallback text, here the built-in language, so you only translate what you want to change.

Give the localizer a class of your own: IStringLocalizer<ChartTexts> would look for the resources in the RioCharts assembly, not yours. Any IStringLocalizer works the same way, also one that reads from a database.

C#
// Program.cs (package Microsoft.Extensions.Localization)
builder.Services.AddLocalization(o => o.ResourcesPath = "Resources");

// ChartResources.cs: a marker class; its texts are Resources/ChartResources.resx, ChartResources.sv.resx, ...
// with keys such as NoData and ResetZoom.
public sealed class ChartResources;
Razor
@* MainLayout.razor *@
@inject IStringLocalizer<ChartResources> L

<CascadingValue Value="_chartTexts">
    @Body
</CascadingValue>

@code {
    private ChartTexts _chartTexts = ChartTexts.English;

    protected override void OnInitialized() =>
        _chartTexts = ChartTexts.From(key => L[key] is { ResourceNotFound: false } s ? s.Value : null,
            fallback: ChartTexts.For(CultureInfo.CurrentUICulture));
}

Skia export takes texts too: ExportOptions.Texts (default: from Culture).

Templates

Some texts are templates: {0}, {1}… are filled in. A text with a count can have two forms separated by |: the first is used when the count is 1, so "{0}: {1} value|{0}: {1} values" reads "Web: 1 value" or "Web: 48 values". A template that cannot be filled in (a stray brace) falls back to English instead of breaking the chart.

All texts

KeyEnglishSvenska
ChartChartDiagram
NoDataNo data availableInga data
ChartFailedThe chart could not be drawnDiagrammet kunde inte ritas
AllSeriesHiddenAll series are hiddenAlla serier är dolda
AllSlicesHiddenAll slices are hiddenAlla delar är dolda
OtherOtherÖvrigt
TotalTotalTotalt
SizeSizeStorlek
ResetZoomReset zoomÅterställ zoom
DownloadDownloadLadda ner
DownloadFormatDownload {0}Ladda ner {0}
DownloadChartDownload chartLadda ner diagram
ChartRolechartdiagram
LegendLegendTeckenförklaring
XAxisX axisX-axel
YAxisY axisY-axel
AxisRange{0}, from {1} to {2}{0}, från {1} till {2}
SeriesPoints{0}: {1} data point|{0}: {1} data points{0}: {1} datapunkt|{0}: {1} datapunkter
SummaryChart with {0} series.Diagram med {0} serie.|Diagram med {0} serier.
SummaryTitledChart "{1}" with {0} series.Diagram "{1}" med {0} serie.|Diagram "{1}" med {0} serier.
SeriesValues{0}: {1} value|{0}: {1} values{0}: {1} värde|{0}: {1} värden
LowestHighestlowest {0} at {1}, highest {2} at {3}lägst {0} vid {1}, högst {2} vid {3}
Trendtrend {0}{0} trend
Risingrisingstigande
Fallingfallingfallande
Stablestablestabil
ValueRange{0} to {1}{0} till {1}
LastValuelast {0}senast {0}
HistogramPeak{0}: {1} value, most from {2} to {3}|{0}: {1} values, most from {2} to {3}{0}: {1} värde, flest från {2} till {3}|{0}: {1} värden, flest från {2} till {3}
RangeBarSummary{0}: {1} bar in {4} rows, from {2} to {3}|{0}: {1} bars in {4} rows, from {2} to {3}{0}: {1} stapel i {4} rader, från {2} till {3}|{0}: {1} staplar i {4} rader, från {2} till {3}
DurationUnitsd h min sd h min s
NoDataShortNo data.Inga data.
BoxMaxMaxMax
BoxUpperQuartileUpper quartileÖvre kvartil
BoxMedianMedianMedian
BoxLowerQuartileLower quartileNedre kvartil
BoxMinMinMin
BoxCountCountAntal
BoxOutliersOutliersAvvikande värden
CandleOpenOpenÖppning
CandleHighHighHögsta
CandleLowLowLägsta
CandleCloseCloseStängning
CandleChangeChangeFörändring
PieChartPie chartCirkeldiagram
DonutChartDonut chartRingdiagram
RadialBarChartRadial bar chartRadiellt stapeldiagram
GaugeChartGaugeMätare
BulletChartBullet chartBulletdiagram
FunnelChartFunnel chartTrattdiagram
FunnelOfFirstOf first stageAv första steget
FunnelOfPreviousOf previous stageAv föregående steg
CalendarChartCalendar heatmapKalenderdiagram
CalendarDays{0} with {1} day: {2}|{0} with {1} days: {2}{0} med {1} dag: {2}|{0} med {1} dagar: {2}
TargetTargetMål
RadarChartRadar chartRadardiagram
TreemapTreemapTrädkarta
ShareOfGroupShare of groupAndel av gruppen
ShareOfTotalShare of totalAndel av totalen
TreemapAllAllAlla
TreemapShowShow {0}Visa {0}
TreemapPathLabelPathSökväg
MapMapKarta
MapWorldWorldVärlden
TreemapLeftOut{0} item with zero or negative value left out|{0} items with zero or negative values left out{0} post med noll eller negativt värde utelämnad|{0} poster med noll eller negativa värden utelämnade
PolarItems{0} with {1} item: {2}|{0} with {1} items: {2}{0} med {1} post: {2}|{0} med {1} poster: {2}
PolarNoData{0}, no data.{0}, inga data.
LegendHidden{0}, hidden{0}, dold
LegendNoData{0}, no data{0}, inga data
Moreand {0} moreoch {0} till
KeysPointsUse Left and Right to move between points.Använd vänster- och högerpil för att flytta mellan punkter.
KeysPointsAndSeriesUse Left and Right to move between points, Up and Down to change series.Använd vänster- och högerpil för att flytta mellan punkter, upp- och nedpil för att byta serie.
KeysSlicesUse the arrow keys to move between slices.Använd piltangenterna för att flytta mellan delarna.
KeysZoomPlus and minus zoom, Shift with Left and Right pans, 0 shows all data.Plus och minus zoomar, Skift med vänster- och högerpil panorerar, 0 visar all data.
KeysSelectPress Enter to select a point, Escape to leave.Tryck Enter för att välja en punkt, Escape för att lämna.
KeysLeavePress Escape to leave.Tryck Escape för att lämna.
Position{0} of {1}{0} av {1}
An unhandled error has occurred. Reload 🗙