One Switch to Turn Off Every Animation in Your Chart
Motion in a chart can be delightful. A bar that grows into place, a toolbar that slides open, a transition that morphs one view into the next — these touches make an interface feel alive. But there are times when you want none of it. Maybe you are embedding a CanvasXpress figure in a kiosk that captures a pixel-perfect screenshot. Maybe you are recording a tutorial and need the chart to appear fully drawn on the very first frame. Maybe your users have told you, plainly, that they want a calm, static interface with no movement at all.
CanvasXpress now gives you exactly that, in a single configuration flag: disableAnimations.
The problem with "turning off animations" the hard way
Historically, suppressing motion in a rich visualization library was a game of whack-a-mole. A chart like CanvasXpress animates in several independent places:
- CSS transitions on the HTML chrome — toolbars, containers, and dialogs that ease in and out.
- CSS keyframe animations — the little slide-ins and flourishes on dialogs and the customizer.
- Canvas render transitions — the drawn tween the engine plays when a chart morphs from one state to another.
- Timer-driven motion — reveals, blinks, and the stepping you see while a network layout settles.
Disabling one of these left the other three running. You could end up with a chart body that snaps instantly while the toolbar still glides, or a dialog that fades while the canvas tweens. Getting a genuinely motion-free embed meant hunting down every mechanism by hand.
disableAnimations covers all four surfaces at once.
How to use it
It is one boolean, set like any other CanvasXpress configuration option:
new CanvasXpress("myChart", {
data: myData,
config: {
graphType: "Bar",
disableAnimations: true
}
});
That is the whole feature from the caller's side. With disableAnimations: true:
- Toolbars, containers, and dialogs appear and disappear without easing.
- Keyframe flourishes are suppressed.
- When the chart updates, it jumps straight to its final state in a single frame — no tween.
- Timer-driven reveals, blinks, and layout stepping snap immediately to their finished positions.
The default is false, so every existing chart behaves exactly as it always has. You opt in only where you want stillness.
Built on the accessibility path you already trust
The elegant part of this feature is what is not new. Modern operating systems let a person say "I prefer reduced motion," and well-behaved software honors that preference. CanvasXpress already did: when the OS reports prefers-reduced-motion: reduce, the engine quiets its animations automatically.
disableAnimations reuses that same, well-tested path. Setting the flag behaves as if the system reduced-motion preference were switched on for that chart — the shared CSS rules and the canvas skip come along for free. On top of that, the feature adds keyframe suppression and the timer guards needed to make the remaining surfaces truly quiet.
This matters for two reasons. First, it means the behavior is consistent with what reduced-motion users already get, so you are not inventing a second, divergent "no animation" mode. Second, it means the feature is scoped and safe: it is applied per chart instance, without injecting global styles that would reach out and touch the rest of your page.
Why a per-chart, scoped switch is the right design
It would have been tempting to ship a blunt instrument — something that stamps transition: none across the entire document. That approach has real costs: it hits every CanvasXpress instance on the page and the host page's own elements too, and it only covers CSS transitions, leaving keyframes, canvas tweens, and timers untouched.
disableAnimations instead attaches a motion-free marker class to the chart's own root element and flips the canvas's internal motion flag. The suppression is expressed through ordinary CSS specificity rather than !important, so it stays contained and predictable. Two charts on the same page can differ: one animated, one still. And because nothing is injected into the global document head, the flag plays nicely alongside the rest of your application's styling.
Where this shines
A few concrete situations where the switch earns its keep:
- Automated capture and testing. If you are screenshotting charts for documentation, reports, or visual comparison, you want the figure fully rendered the instant it is ready — no waiting for a tween, no risk of catching a frame mid-animation.
disableAnimations: truemakes the rendered output deterministic. - Calm, low-distraction dashboards. Operations screens and clinical displays often favor stillness. Motion can read as "something changed, pay attention" — exactly the wrong signal on a wall of steady metrics.
- Accessibility, explicitly. Beyond respecting the OS setting automatically, you can now guarantee a motion-free experience for a specific embed, regardless of the viewer's system configuration.
- Embedding inside other animated UIs. When your surrounding application already has its own motion language, a chart that layers its own transitions on top can feel busy. Turn the chart's motion off and let your app's choreography lead.
Nothing else changes
disableAnimations is purely a gate. It does not remove or weaken any animation; it does not alter how your data is drawn, how colors resolve, or how interactions behave. Hover, zoom, selection, export — all of it works the same. The only difference is that the paths that would have animated now resolve instantly.
That is the whole point: one honest switch, default off, that gives you a completely still chart whenever you ask for one — and leaves everything else exactly as it was.