Milestone timeline
Dates down a line, with a card on one side then the other. Good for the story of a project or a company, in a few steps.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'milestones',
data: [
{ date: 'Jan 2024', title: 'First idea', text: 'A sketch on paper and three people around a table.', done: true },
{ date: 'Jun 2024', title: 'Prototype', text: 'Ten testers use it every day for a month.', done: true },
{ date: 'Feb 2025', title: 'Public launch', text: 'Open to everybody, free for small teams.', done: true },
{ date: 'Oct 2025', title: 'Mobile app', text: 'The same tools in the pocket, offline too.', done: true },
{ date: 'May 2026', title: 'Ten thousand users', text: 'And a team of twelve.' },
{ date: '2027', title: 'Next steps', text: 'New languages and a plan for schools.' },
],
};
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type milestones takes:
/** Milestones down a line, their cards on one side then the other. */
interface MilestonesSpec extends Base {
type: 'milestones';
data: Milestone[];
}
interface Milestone {
date: string;Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More