React Timeline Chart
A React timeline chart with ApexCharts in AdminKit PRO: tasks as horizontal bars from a start to an end date, drawn as a rangeBar chart.
This component is only available in AdminKit PRO. Learn more.
A timeline chart shows when things happen and how long they take. Each task or event is a bar on a time axis, from its start date to its end date, like a simple Gantt chart.
In AdminKit for React you draw it with ApexChart (Chart setup). For ApexCharts, a timeline is a rangeBar chart with horizontal bars.
Example
import { ApexChart } from "@/components/plugins/apexcharts";
const day = (date: string) => new Date(date).getTime();
const tasks = [
{ x: "Code", y: [day("2026-03-02"), day("2026-03-04")] },
{ x: "Test", y: [day("2026-03-04"), day("2026-03-08")] },
{ x: "Validation", y: [day("2026-03-08"), day("2026-03-12")] },
{ x: "Deployment", y: [day("2026-03-12"), day("2026-03-18")] },
];
export function ReleaseTimeline() {
return (
<div className="position-relative" style={{ minHeight: 365 }}>
<ApexChart
options={() => ({
series: [{ data: tasks }],
chart: { height: 350, type: "rangeBar" },
plotOptions: { bar: { horizontal: true } },
xaxis: { type: "datetime" },
})}
/>
</div>
);
}The bars take the primary color, the first default color of the wrapper.
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 |
Data
Each bar is { x, y }. x is the task, shown as the label on the y-axis. y is [start, end], as timestamps.
new Date("2026-03-02") reads a date without a time as midnight UTC. ApexCharts shows datetime labels in UTC too, so the bars start on the day boundaries.
Sometimes one task should stand out, such as the one in progress. Give that point its own color with fillColor, here a theme color:
<ApexChart
options={(theme) => ({
series: [
{
data: [
{ x: "Code", y: [day("2026-03-02"), day("2026-03-04")] },
{
x: "Test",
y: [day("2026-03-04"), day("2026-03-08")],
fillColor: theme.warning,
},
],
},
],
chart: { height: 350, type: "rangeBar" },
plotOptions: { bar: { horizontal: true } },
xaxis: { type: "datetime" },
})}
/>With several series, for example one per team, ApexCharts draws each in its own color and lists them in the legend.
Accessibility
- The start and end dates show in the tooltip on hover only. List the dates in text or a table next to the chart, such as in a task list.
- A
fillColorthat marks a state also needs that state in text: color alone does not tell it. - Name the chart with
role="figure"andaria-label="Release 2.4 schedule".ApexChartputs other props on its<div>.
Related
- Next.js timeline chart: the same chart in AdminKit for Next.js
- Bootstrap 5 timeline chart: the ApexCharts example of the HTML version
- Chart setup: the
ApexChart,ChartJsandVectorMapcomponents - React column chart: bars from zero, for values per category
- ApexCharts demo: the line, area, bar, column, pie, heatmap, mixed and candlestick charts of the demo
Last updated on
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.
Treemap chartPro
A React treemap chart with ApexCharts in AdminKit PRO: values as nested rectangles sized by value, drawn by the ApexChart component.