Skip to content

Queues at counters ​

People waiting at each counter, and how long it will take. Good for shops, banks, offices, airports and help desks.

The smallest code that works. change the code, then press Run

In your framework

import { Chart } from 'nervure/react';

const spec = {
  type: 'queue',
  counters: [
    { name: 'Desk 1', waiting: 6, open: true, minutes: 3 },
    { name: 'Desk 2', waiting: 2, open: true, minutes: 3 },
    { name: 'Desk 3', waiting: 1, open: true, minutes: 2 },
    { name: 'Desk 4', waiting: 7, open: true, minutes: 3 },
    { name: 'Desk 5', waiting: 0, open: false, minutes: 2 },
    { name: 'Desk 6', waiting: 3, open: true, minutes: 2 },
  ],
};

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 queue takes:

/** Queues at counters, desks or checkouts: people waiting and the time it takes. */
interface QueueSpec extends Base {
  type: 'queue';
  counters: Counter[];
  onItemClick?: (name: string) => void;
}

interface Counter {
  name: string;

Style it

  • Colours: theme.palette, chart.setColor(name, colour), or --nervure-palette in your CSS. More
  • Marks: [data-series="name"], parts: [data-part="axes"], legend, series. What you change is kept in exports.
  • Movement: animation: false draws at once. More
  • Files: chart.download('png'), svg, csv. More

Close to it