Skip to content

Modern Tui TuiSparkline

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Charts › TuiSparkline

TuiSparkline

Draws a one-row trend of values as block characters, one value per cell.

Syntax

type TuiSparkline extends TuiWidget
    as TuiDoubleArray data
    as TuiColor color
end type

Description

A single row of block characters -- one value per cell, eight height steps. For a trend beside a number, where a full graph would be too much.

Example

#import "std/tui"
using tui

dim as TuiScreen scr
scr.Resize( 20, 1 )
dim as TuiFrame ptr f = scr.BeginFrame( )

dim as TuiSparkline sl
for i as int32 = 0 to 19
    sl.data.Push( cdbl( i ) )     '' TuiDoubleArray: push a double
next
sl.color = TuiRgb( 120, 220, 160 )
sl.Render( *f, f->Area( ) )
print sl.data.Count( )            '' 20

See also

TuiCanvas TuiCanvas.Dot TuiCanvas.DotWidth TuiCanvas.CellRows
TuiCanvas.Resize TuiCanvas.Line_ TuiCanvas.DotHeight TuiCanvas.Pattern
TuiCanvas.Clear TuiCanvas.Blit TuiCanvas.CellCols TuiSeries

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Charts
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally