Large data
Charts with hundreds of thousands of points stay fast in Blazor: pass columns directly and let LTTB downsampling keep the shape at the plot's resolution. Draw the series on a canvas when the DOM gets heavy; zooming in downsamples only the visible points, so detail appears.
200 000 points
A month of server response times, one every 13 seconds, running in WebAssembly in your browser. Drag to zoom in.
Series layer: Canvas
Code
<RioChart TItem="double" Zoomable="true" SeriesLayer="SeriesLayer.Canvas" YAxis="@(new AxisOptions { Title = "ms" })">
<LineSeries Name="Response time" Data="SeriesData.From(times, values)" StrokeWidth="1.25" Format="0 ms" />
</RioChart>100 000 points in a scatter
Minutes on the site against order value for 100 000 orders. Points are data, so a scatter is never downsampled, but where markers pile up only three are drawn per square one marker radius wide: by then the translucent markers are solid, so the picture is the same. Outliers and sparse areas keep every point; the trend line uses them all. Drag to zoom into the dense corner.
Code
<RioChart TItem="double" Zoomable="true" SeriesLayer="SeriesLayer.Canvas"
XAxis="@(new AxisOptions { Title = "Minutes on the site" })" YAxis="@(new AxisOptions { Title = "Order value, €" })">
<ScatterSeries Name="Orders" Data="SeriesData.From(minutes, values)" MarkerSize="4" TrendLine="true" Format="0 €" />
</RioChart>Guidelines
- Use
SeriesData.From(times, values)for big series: no per-item selectors, no boxing. - Downsampling is automatic (twice the plot width, four times on a canvas); set
DownsampleThresholdto change it. - Scatter series are thinned instead: above the same threshold, at most three markers in each small square. Hover and tooltips use the drawn points.
SeriesLayer.Canvaskeeps axes, labels and annotations in SVG and draws only the series on a canvas.- Update with a new
SeriesDataor aDataVersion; for streams use aSeriesBuffer.
Canvas compared with SVG
With SeriesLayer.Canvas the series are painted on a canvas laid over the SVG chart; axes, grid, legend, labels and
annotations stay in SVG. Tooltips, clicks, zoom and pan work the same, since they use the chart's own hit testing. These differ:
| What | On a canvas |
|---|---|
| Data labels and annotations | Drawn under the series, also annotations with Layer="AnnotationLayer.Above". A line can cross a label. |
| Highlight | Hovering a legend item or HighlightSeriesAsync does not fade the other series. |
| Entry fade | The series appear at once instead of fading in. |
| Downsampling | Line and area series keep four times the plot width (at least 2000 points) instead of twice. |
| Styling | Colors and theme tokens apply, and the canvas repaints when the theme changes; your own CSS rules on the series' SVG elements do not. |
| Image export | ExportSvgAsync writes the series as a PNG image inside the SVG; ExportPngAsync is unaffected. Server export with RioCharts.Skia always draws vectors. |
| Static rendering | Static server rendering and prerendering draw the series in SVG; the canvas takes over once the chart runs interactively. |
| Maps | Drawn in SVG, countries and bubbles; SeriesLayer has no effect. |
Use SVG unless the series have many thousands of drawn shapes; most charts never need the canvas.