static renders a LiveChart once with zero per-frame animation loops. The engine tick
loop, the degen/trade/candle/marker callbacks, the pulse, and the entry reveal are all
disabled. That makes each instance cheap enough to put dozens of them in a scrolling list — a
watchlist row, a token grid, a portfolio of sparklines.
Touch interaction still works: scrub and scrubAction are on-demand gestures with no
per-frame loop, so a static chart costs nothing at rest yet becomes scrubbable the moment a
finger lands on it — see Scrubbing a static chart below.
It mirrors react-native-graph’s animated={false}.
Hundreds of static sparklines in one virtualized, recycled list
When to use it
Reach forstatic when you’re rendering many mini-charts at once and don’t need each one
to animate continuously. A single hero chart should stay live; a FlatList of forty thumbnails
should be static. They can still be scrubbed on touch (see below) — static only turns off
the continuous loop, not interaction.
A sparkline cell
Strip the chrome you don’t need in a thumbnail — badge, axes, pulse — and frame the data edge-to-edge:Framing the data
A static chart never scrolls, so you decide exactly what’s on screen. SettimeWindow to the
span you want to show and nowOverride to your dataset’s last timestamp (unix seconds) so the
window ends right at the latest point. This is the same approach as the
historical data fill pattern.
Scrubbing a static chart
static turns off the continuous render loop, not interaction — so a still sparkline is still
scrubbable. scrub (and scrubAction) are event-driven gestures: they cost nothing while the
finger is off the chart, and on touch they read the already-settled geometry. So you get a
zero-idle-cost cell that reveals its crosshair / value read-out the moment it’s pressed:
static, which also took scrubbing with it; now you can have both.
Continuous animations —
pulse, degen, the entry reveal — stay off in static mode (they’re
loops, not gestures). Only the on-demand touch gestures (scrub, scrubAction) remain live.Pausing off-screen charts in a long list
Becausestatic is a prop, you can flip it from a list’s viewability callback: render off-screen
rows static (loop fully off, still scrubbable if they peek on screen) and the visible hero row
live. Toggling static → live resumes the loop and catches up.
Mounting a big grid: batch it
static makes a settled sparkline nearly free at rest, but the mount isn’t free — each
chart builds its full hook tree once. Mounting dozens in a single commit (a non-virtualized grid)
can hold up a navigation for a beat. Two ways out:
- Virtualize — a
FlatList/ LegendList only mounts what’s visible (see the Coin list demo). - Defer — for a fixed grid, render same-size placeholders in the first commit and mount the
cells a couple of
requestAnimationFrames later, so the screen transition lands instantly. Keep the deferral state in the grid component andmemothe cells so the batch re-renders nothing else. (Prefer one deferred batch over many tiny ones — deferred renders are time-sliced, so each extra batch adds real overhead.) The demo’sapp/demo/sparklines.tsxshows the pattern.
static vs paused
They sound similar but do opposite things:
pausedfreezes a live chart — the tick loop keeps running, the value keeps buffering, and resuming catches the window back up to real time. Use it for one interactive chart.staticremoves the loops entirely — nothing animates and nothing recovers, because there’s nothing to recover. Use it for many instances at once. Scrubbing still works (above).
LiveChart reference.