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 →


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)Cuándo usarlo
Sección titulada «Cuándo usarlo»- En línea junto a un número o en una celda, cuando importa más la tendencia que los valores.
import pyzed as pzfrom 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)Variantes
Sección titulada «Variantes»Opciones
Sección titulada «Opciones»

Código
ui.sparkline([1, 4, 2, 6, 3, 7, 5, 8], width=200, height=40)

fill=FalseCódigo
ui.sparkline([1, 4, 2, 6, 3, 7, 5, 8], width=200, height=40, fill=False)

tint="error"Código
ui.sparkline([8, 6, 7, 4, 5, 3, 2, 1], width=200, height=40, tint="error")

tint="success"Código
ui.sparkline([2, 3, 3, 5, 6, 8, 9, 12], width=200, height=40, tint="success")

width=80, height=20Código
ui.sparkline([3, 5, 2, 6, 4, 7], width=80, height=20)

width=280, height=64Código
ui.sparkline([3, 5, 2, 6, 4, 7, 5, 9, 6, 8], width=280, height=64)Eventos
Sección titulada «Eventos»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.
Propiedades y API
Sección titulada «Propiedades y API»ui.sparkline
Sección titulada «ui.sparkline»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()). |
Relacionados
Sección titulada «Relacionados»CifraUna cifra de dashboard con variación y minigráfico.
Gráfico de barrasUn gráfico de barras verticales con etiquetas.