Chart Container

Ready-made chart layout root — bind a Dataset, tune props, or compose plot children.

Use ChartContainer when you need explicit control over axes, series, plot inset, and child plot layers. For common chart types, prefer the *Chart convenience components (e.g. crate::BarChart).

  • Mixed-type dashboards (bar + line overlay) or custom SVG annotations.
  • Full control over which plot children render and their z-order.
  • Processed Dataset output from a DataTable without a convenience *Chart wrapper.
  • Bind a shared Dataset with binding or field keys that match your DataTable columns.
  • Set explicit width and height for fixed tiles, or wrap with ResponsiveChartContainer for parent-fill layouts.
  • Add plot children (BarPlot, LinePlot, etc.) in composition mode; otherwise the container renders axes only.
  • Opt into legend, tooltip, and highlight_scope when the dashboard needs exploration — defaults are None for lightweight embeds.
  • Wrap previews in a native element with data-testid for E2E hooks.
Basic container with axes and grid

Minimal shell proving band x-axis, linear y-axis, and grid wiring. Start here before adding plot children or binding a live Dataset from a DataTable.

200k400k600kAmount (USD)Q1Q2Q3Q4Quarter
Loading overlay

Sets loading=true while async data fetches run. The container shows Spinner and Skeleton chrome instead of an empty plot — pair with your data resource's pending state.

0.20.40.60.81
Loading chart data…
Custom layer via hooks

Dashed baseline drawn in SVG space using crate::use_drawing_area and crate::use_y_scale. Use this pattern for annotations that must stay aligned on resize.

200k400k600kAmount (USD)Q1Q2Q3Q4Quarter