React Mixed Chart
A React mixed chart with ApexCharts in AdminKit PRO: columns, an area and a line in one chart, with a shared tooltip, drawn by the ApexChart component.
This component is only available in AdminKit PRO. Learn more.
Use a mixed chart when one chart type does not suit all your series. It draws different types on the same axes: this example has a column series, an area series and a line series.
In AdminKit for React you draw it with ApexChart, the ApexCharts component described in Chart setup.
Example
import { ApexChart } from "@/components/plugins/apexcharts";
export function TeamPointsChart() {
return (
<div className="position-relative" style={{ minHeight: 365 }}>
<ApexChart
options={() => ({
chart: { height: 350, type: "line", stacked: false },
stroke: { width: [0, 2, 5], curve: "smooth" },
plotOptions: { bar: { columnWidth: "50%" } },
series: [
{
name: "TEAM A",
type: "column",
data: [23, 11, 22, 27, 13, 22, 37, 21, 44, 22, 30],
},
{
name: "TEAM B",
type: "area",
data: [44, 55, 41, 67, 22, 43, 21, 41, 56, 27, 43],
},
{
name: "TEAM C",
type: "line",
data: [30, 25, 36, 30, 45, 35, 64, 52, 59, 36, 39],
},
],
fill: {
opacity: [0.85, 0.25, 1],
gradient: {
inverseColors: false,
shade: "light",
type: "vertical",
opacityFrom: 0.85,
opacityTo: 0.55,
stops: [0, 100, 100, 100],
},
},
labels: [
"01/01/2026", "02/01/2026", "03/01/2026", "04/01/2026",
"05/01/2026", "06/01/2026", "07/01/2026", "08/01/2026",
"09/01/2026", "10/01/2026", "11/01/2026",
],
markers: { size: 0 },
xaxis: { type: "datetime" },
yaxis: { title: { text: "Points" }, min: 0 },
tooltip: {
shared: true,
intersect: false,
y: {
formatter: (y?: number) =>
typeof y !== "undefined" ? y.toFixed(0) + " points" : String(y),
},
},
})}
/>
</div>
);
}On the ApexCharts page of the demo, this chart sits in a card next to the other chart types.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
options | (theme: Theme) => ApexOptions | The ApexCharts options, with series and chart.type. Called again with the new colors when the color mode changes |
How the series combine
chart.typeis the base type,"line". Each series sets its owntype:"column","area"or"line".- Options that take an array apply per series, in order.
stroke.width: [0, 2, 5]gives the columns no outline, the area a 2px line and the line 5px.fill.opacity: [0.85, 0.25, 1]makes the area light enough to see the columns behind it. labelsare the x values of all series. Withxaxis.type: "datetime"they are dates, here the first day of each month.tooltip.shared: truewithintersect: falseshows the three values of a date in one tooltip, wherever the pointer is on that date.- The series take the primary, success and warning colors of the wrapper. To pick theme colors per series, return
colors: [theme.primary, theme.info, theme.warning]from(theme) => ({ ... }).
Accessibility
- The legend names each team next to its color.
- The y-axis title, "Points", gives the unit. The shared tooltip shows the exact values on hover only, so give the figures in a table where they matter.
ApexChartpasses other props to its<div>: name the chart withrole="figure"and anaria-label.
Related
- Next.js mixed chart: the same chart in AdminKit for Next.js
- Bootstrap 5 mixed chart: the ApexCharts example of the HTML version
- Chart setup: the
ApexChart,ChartJsandVectorMapcomponents - React column chart and React area chart: the two types on their own
- ApexCharts demo
Last updated on
Heatmap chartPro
A React heatmap chart with ApexCharts in AdminKit PRO: a grid of cells shaded by value, with color ranges from the theme for light and dark mode.
Scatter chartPro
A React scatter chart with ApexCharts in AdminKit PRO: three samples of points on two numeric axes, with zoom on both axes, in light and dark mode.