Skip to main content
WireKit
Copy for LLM

Chart Mixed

<x-wirekit::chart-mixed> renders a chart where each dataset carries its OWN type (line / bar / area) plus an optional yAxisID pointing at a multi-axis configuration. Both adapters consume the per-dataset type field natively. Chart.js renders bar as vertical bars by default; ApexCharts renders horizontal bars by default and accepts an explicit column synonym for vertical bars at the chart level — to keep examples portable we use bar and let each adapter render its native default.

Basic Example — Revenue (bar) + Growth (line)

Quarterly revenue with growth-rate overlay

Multi-axis Example

Dual y-axis — left for revenue, right for growth %

Three-type combo

Sales pipeline: leads (bar) + qualified (area) + won (line)

License note

When the active library is ApexCharts (charts.library => 'apexcharts'), the ApexCharts non-MIT license terms apply — see the License section on the Chart overview page for the full details. WireKit's Chart Mixed glue (this component) is MIT-licensed regardless of which adapter is active.

Props

Prop Type Default Description
labels array [] X-axis labels
datasets array [] Each entry must include type + data; optional yAxisID for multi-axis binding
options array [] Adapter-specific options (e.g. yaxis array for multi-axis)
height string '380px' CSS height
scope string|null null Personalization scope
library string|null null Per-instance chart-library override. Forwards to the underlying <x-wirekit-chart> — see chart Props.

Keyboard Interaction

This component is purely presentational and does not respond to keyboard input.

Pitfalls

  • Don't mix radically different scales without a multi-axis configuration. A column with values in the millions and a line with values in single digits will compress the line to invisibility on a single y-axis.
  • Validate every dataset has a data array. The component throws InvalidArgumentException for malformed input — better to fail loudly than render silently broken charts.

Design Tokens

Mixed charts compose multiple series types in a single canvas — bar + line, area + line, scatter + line, etc. Per-series styling reads the same WireKit color palette as the base Chart component: --color-wk-accent, --color-wk-success, --color-wk-warning, --color-wk-danger, --color-wk-info for the dataset colors; --color-wk-text / --color-wk-text-muted for legend + axis labels; --color-wk-border for the grid; --font-wk-sans for typography.

Dark mode swaps the entire palette atomically when the .dark class toggles on <html> (same MutationObserver re-paint as the single-type charts).

See Also