Skip to content

Dashboards ​

ts
import { createDashboard } from 'nervure/dashboard';

const board = createDashboard(host, {
  link: true,       // a series hidden in one chart is hidden in all
  editable: true,   // cards move with the mouse, or the arrow keys on their title
  onMove: (ids) => localStorage.setItem('order', JSON.stringify(ids)),
  items: [
    { id: 'revenue', title: 'Revenue', width: 8, height: 3, spec: revenue },
    { id: 'goal', title: 'Goal', width: 4, height: 3, spec: goal, options: { toolbar: true } },
  ],
});

board.update('goal', nextGoal);
board.add({ id: 'map', title: 'Map', width: 12, spec: map });
board.move('map', 0);
board.chart('revenue')?.download('png');
board.destroy();
OptionDefaultDoes
columns12columns of the grid
rowHeight, gap110, 16pixels
stackUnder640under this width, one card by line
theme, locale, animation, toolbargiven to every chart

Cards are plain HTML: style .nervure-dashboard, .nervure-card and .nervure-card-title.