Skip to content

3D bar chart ​

Isometric columns on a floor of rows and columns. Good for a few values on two dimensions, when the picture has to strike.

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

In your framework

import { Chart } from 'nervure/react';

const spec = {
  type: 'bars3d',
  rows: ['2024', '2025', '2026'],
  columns: ['Q1', 'Q2', 'Q3', 'Q4'],
  values: [[61, 51, 33, 58], [30, 29, 69, 63], [37, 39, 36, 36]],
};

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

interface Bars3DSpec extends Base {
  type: 'bars3d';
  rows: string[];
  columns: string[];
  values: number[][];
  colors?: 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