Event timeline
Dates along a line. Good for a history in a few moments.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'events',
data: [
{ date: '2019', text: 'First shop' },
{ date: '2021', text: 'Online sales' },
{ date: '2023', text: 'Second country' },
{ date: '2024', text: 'New warehouse' },
{ date: '2026', text: 'One million clients' },
],
};
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 events takes:
interface EventsSpec extends Base {
type: 'events';
data: { date: string; text: string; color?: 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