Ir al contenido

StackedBar

Barras apiladas para mostrar un total y sus partes en cada periodo. Es BarChart con stacked.

import { BarChart } from '@sypnia/ui/react'

En esta página
  1. Almacenamiento por tipo
  2. Cuándo usarlo
  3. Para todos
  4. Props

Almacenamiento por tipo

Storage by kind
GB, per month
  • Database
  • Files
  • Backups
0204060JulAugSepOctNov
Ver como tabla
DatabaseFilesBackups
Jul1263
Aug1473
Sep1794
Oct19124
Nov23135
Código
import { BarChart } from '@sypnia/ui/react';

// Bars stacked to show a total and its parts in each period.
export default function Parts() {
  return <BarChart stacked title="Storage by kind" subtitle="GB, per month" x={['Jul', 'Aug', 'Sep', 'Oct', 'Nov']}
    series={[{ id: 'db', label: 'Database', data: [12, 14, 17, 19, 23] }, { id: 'files', label: 'Files', data: [6, 7, 9, 12, 13] }, { id: 'backups', label: 'Backups', data: [3, 3, 4, 4, 5] }]} />;
}

Cuándo usarlo

Úsalo cuando

  • Totales cuyas partes importan: almacenamiento por tipo.

No lo uses cuando

  • Comparar las partes del medio: solo la de abajo empieza en cero.

Para todos

  • El tooltip y la tabla dan cada parte en números.

Props

BarChartTipoPor defecto
seriesobligatorio Series[]
titleobligatorio ReactNode
xobligatorio

The positions along the horizontal axis: dates, hours, names.

string[]
empty ReactNode
error ReactNode
formatValue

How a value is written in ticks, tooltip and table. Defaults to a compact number in the person's language.

((v: number) => string)
height number
loading boolean
stacked

Series on top of each other (parts of a total) instead of side by side.

boolean false
subtitle ReactNode
xLabel

The header of the first column of the table view: what `x` is.

string
  1. Almacenamiento por tipo
  2. Cuándo usarlo
  3. Para todos
  4. Props

    Busca páginas, secciones y términos