Ir al contenido

Minigráfico

Un gráfico de líneas pequeño, relleno bajo la línea por defecto, que muestra la forma de una serie.

ui.sparkline · Categoría: Datos · Referencia completa →

MinigráficoMinigráfico
  • En línea junto a un número o en una celda, cuando importa más la tendencia que los valores.
import pyzed as pz
from pyzed import ui
pz.column([
ui.sparkline([1, 4, 2, 6, 3, 7, 5, 8], width=240, height=48),
ui.sparkline([8, 6, 7, 4, 5, 3, 2, 1], width=240, height=48, tint="error", fill=False),
], spacing=16)
Minigráfico: RellenoMinigráfico: Relleno
Relleno
Código
ui.sparkline([1, 4, 2, 6, 3, 7, 5, 8], width=200, height=40)
Minigráfico: fill=FalseMinigráfico: fill=False
fill=False
Código
ui.sparkline([1, 4, 2, 6, 3, 7, 5, 8], width=200, height=40, fill=False)
Minigráfico: tint="error"Minigráfico: tint="error"
tint="error"
Código
ui.sparkline([8, 6, 7, 4, 5, 3, 2, 1], width=200, height=40, tint="error")
Minigráfico: tint="success"Minigráfico: tint="success"
tint="success"
Código
ui.sparkline([2, 3, 3, 5, 6, 8, 9, 12], width=200, height=40, tint="success")
Minigráfico: width=80, height=20Minigráfico: width=80, height=20
width=80, height=20
Código
ui.sparkline([3, 5, 2, 6, 4, 7], width=80, height=20)
Minigráfico: width=280, height=64Minigráfico: width=280, height=64
width=280, height=64
Código
ui.sparkline([3, 5, 2, 6, 4, 7, 5, 9, 6, 8], width=280, height=64)

Minigráfico no tiene eventos propios: muestra lo que le das. Como todo widget, también tiene los 18 eventos comunes (click, double_click, right_click, mouse_enter, drag, key_down, resize…), que se conectan con .on(...): mira Eventos y Eventos de cada componente.

sparkline(values, *, width=120, height=32, tint='accent', fill=True, theme=None)

Un gráfico de línea diminuto para tendencias.

Propiedad Por defecto Descripción
values obligatorio Valores.
width 120 Ancho: píxeles, "fill", "shrink" o "fill:N" (proporción).
height 32 Alto: píxeles, "fill", "shrink" o "fill:N" (proporción).
tint "accent" Color semántico: "accent", "error", "warning", "success", "info" o un token.
fill True Rellena el área bajo la línea.
theme None Tema a usar en lugar del actual (pyzed.theme.current()).

Referencia completa →