Zoom and pan
Zoom and pan with drag, pinch, Ctrl+wheel or the keyboard. Zoom previews run in the browser; only the finished zoom calls back into .NET, so zooming stays smooth on Blazor Server too.
Zoom and pan
Zoomable="true": drag to zoom, Shift+drag to pan, Ctrl/⌘+wheel to zoom at the pointer, double-click to reset.
On touch screens, pinch to zoom and move two fingers to pan. The y axis fits the visible data.
@bind-VisibleRange reads and sets the visible x range.
Visible: all
Code
<RioChart TItem="Reading" Zoomable="true" @bind-VisibleRange="range">
<LineSeries Items="web" Name="Web" XValue="r => r.Time" YValue="r => r.Value" />
<LineSeries Items="app" Name="App" XValue="r => r.Time" YValue="r => r.Value" />
</RioChart>
<button @onclick="() => range = ChartRange.Of(from, to)">Zoom</button>Linked charts
Charts in the same Group share the crosshair and the zoom, and line up their plots. Zoom either chart and the
other follows.
Code
<RioChart TItem="Reading" Zoomable="true" Group="store">
<LineSeries Items="web" ... />
</RioChart>
<RioChart TItem="Reading" Zoomable="true" Group="store">
<AreaSeries Items="revenue" ... />
</RioChart>From code
Take a reference with @ref and call ZoomToAsync, PanAsync, ResetZoomAsync or
GetVisibleRange. OnZoomChanging can change or cancel a zoom the user made. On the keyboard, +,
−, Shift+←/→ and 0 zoom, pan and reset (see
Keyboard access).