Kanban board
Columns of cards, with the work allowed in each column. Good for where the work stands, and where it piles up.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'kanban',
columns: [
{
name: 'To do',
cards: [
{ title: 'Sign-up page', tag: 'API', owner: 'Amira Ben Ali' },
{ title: 'Price export', tag: 'API', owner: 'Amira Ben Ali' },
{ title: 'Dark theme', tag: 'Design', owner: 'Sara Mejri' },
{ title: 'Map legend', tag: 'Docs', owner: 'Omar Jaziri' },
],
},
{
name: 'Doing',
limit: 3,
cards: [
{ title: 'Search', tag: 'API', owner: 'Omar Jaziri' },
{ title: 'Invoices', tag: 'Bug', owner: 'Amira Ben Ali' },
],
},
{
name: 'Review',
limit: 2,
cards: [
{ title: 'Onboarding', tag: 'Design', owner: 'Omar Jaziri' },
{ title: 'Release notes', tag: 'API', owner: 'Omar Jaziri' },
],
},
{
name: 'Done',
cards: [
{ title: 'Cache', tag: 'Design', owner: 'Omar Jaziri' },
{ title: 'Mobile menu', tag: 'Docs', owner: 'Omar Jaziri' },
{ title: 'Alerts', tag: 'Docs', owner: 'Omar Jaziri' },
],
},
],
};
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 kanban takes:
/** A board of columns and cards; `limit` marks a column holding too much work. */
interface KanbanSpec extends Base {
type: 'kanban';
columns: {
name: string;
color?: string;
/** Most cards wanted in the column: the count turns red beyond. */
limit?: number;
cards: { title: string; tag?: string; owner?: 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