ChartContainer
import { ChartContainer } from '@wick-charts/react'; <ChartContainer theme={catppuccin.theme}> <LineSeries data={data} /></ChartContainer>Top-level React wrapper that creates a ChartInstance and provides it to children via context. Owns the DOM container and canvas lifecycle; renders children as an overlay layer.
Detects <Title>, <InfoBar>, and <Legend> children and positions them as:
- Title + InfoBar — absolutely-positioned *overlays* stacked at the top of the canvas
block, so the canvas (and therefore the grid) fills the full container height. The stacked height is measured and fed back into chart.setPadding({ top }) so series data stays below them.
- Legend — flex sibling at the bottom (or right, when position="right"), so its height is
reserved by browser layout.
The root component every chart starts with. Provides theme, axis configuration, padding, and the canvas; collects series and overlays from its children. Use viewport={{ maxVisibleBars, initialRange }} to size the streaming window and apply an initial zoom *before* the first paint (same shape as the imperative chart.setVisibleRange).
Props
Render prop
// <ChartContainer> accepts arbitrary children.