Charts Zoom Pan
Zoom and pan let users focus on part of a dense chart — scroll to zoom, drag to pan, pinch on touch devices.
Turn it on per axis with ZoomConfig, constrain span with min_span, and optionally sync companion axes with filter_mode when the vertical axis should follow the visible horizontal range.
- Long time series where the default view is too dense to read.
- Exploration dashboards where users drill into a date range before taking action.
- Line and bar charts with
ChartFeatures::ZOOM_PANenabled on the chart root.
- Set
zoomconfig on the axis definition (enabled: true, optionalmin_span). - Enable
features=ChartFeatures::ZOOM_PANon the chart component. - Hold zoom state in an
RwSignal<Vec<ZoomWindow>>for controlled mode and reset buttons. - Wire
on_zoom_changewhen parent state must persist across re-renders.
Zoom and pan on line and bar charts
Scroll wheel zooms the monthly x-axis; drag pans; Reset restores the full domain. Controlled zoom signal is shared between line and bar so both stay in sync.