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
Datasetoutput from a DataTable without a convenience*Chartwrapper.
- Bind a shared
Datasetwithbindingor field keys that match your DataTable columns. - Set explicit
widthandheightfor fixed tiles, or wrap withResponsiveChartContainerfor parent-fill layouts. - Add plot children (
BarPlot,LinePlot, etc.) in composition mode; otherwise the container renders axes only. - Opt into
legend,tooltip, andhighlight_scopewhen the dashboard needs exploration — defaults areNonefor lightweight embeds. - Wrap previews in a native element with
data-testidfor 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.
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.