Documentation menu

Gestures and keyboard

The chart handles input itself; bindings only translate platform events into InputEvents (ferrochart-winit and ferrochart-wasm do this for you).

Gestures

InputEffect
Drag in the plotPan (release while moving: kinetic scrolling)
Wheel / trackpad scrollZoom time around the pointer; horizontal scroll or Shift+wheel pans
Wheel over the price axis, or Alt+wheelZoom prices
Pinch (trackpad, touch)Zoom
Drag the price axisScale prices (turns auto-scale off)
Drag the time axisChange the bar spacing
Double-click an axisReset it (auto-scale, default spacing)
← → / ↑ ↓Pan by 10 % / zoom
Home / EndJump to the first / latest bar

The crosshair follows the pointer, with price and time labels on the axes. Its mode is Normal, Magnet (snaps to the nearest of the bar's open, high, low and close) or Hidden.

Events

What the chart reports back (crosshair moves, clicks, visible range changes, history requests, drawing changes) is described in Crosshair and events. In Rust, pull the same events with Chart::drain_events; if you don't drain them for a while, newer crosshair and range events replace older ones instead of piling up.

Time

Input events carry a timestamp (time_ms) and build_frame takes the current time (now_ms); both must come from the same clock. Kinetic scrolling uses them. The bindings use performance.now() (web) or a monotonic clock started with the window (desktop).