Ir al contenido

AreaChart

Una línea con un velo suave debajo, para una cantidad que se acumula: almacenamiento usado, registros totales. Dos o más series llevan leyenda.

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

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

Almacenamiento usado

Storage used
Last 8 weeks
  • Database
  • Files
0 B191 MB381 MB572 MB763 MBW1W2W3W4W5W6W7W8
Ver como tabla
WeekDatabaseFiles
W1114 MB38 MB
W2172 MB57 MB
W3248 MB86 MB
W4296 MB143 MB
W5401 MB153 MB
W6448 MB210 MB
W7534 MB248 MB
W8582 MB286 MB
Código
import { AreaChart, useSypnia } from '@sypnia/ui/react';

// A quantity that accumulates: the wash under the line says «this much, so far».
export default function Storage() {
  const { format } = useSypnia();
  return <AreaChart title="Storage used" subtitle="Last 8 weeks" xLabel="Week" x={['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8']}
    formatValue={(v) => format.bytes(v * 1e6)} series={[{ id: 'db', label: 'Database', data: [120, 180, 260, 310, 420, 470, 560, 610] }, { id: 'files', label: 'Files', data: [40, 60, 90, 150, 160, 220, 260, 300] }]} />;
}

Cuándo usarlo

Úsalo cuando

  • Totales que crecen con el tiempo.

No lo uses cuando

  • Tasas y porcentajes: usa LineChart.
  • Más de tres series: los velos se tapan entre sí.

Para todos

  • Pasa el puntero o enfoca para leer todas las series en un punto; la tabla tiene todos los números.

Props

AreaChartTipoPor 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
subtitle ReactNode
xLabel

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

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

    Busca páginas, secciones y términos