Skip to content

Modern Tui TuiBarChart

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

Home › Terminal TUI Library › Charts › TuiBarChart

TuiBarChart

Draws labelled bars, vertical or horizontal, scaled to the largest value.

Syntax

type TuiBarChart extends TuiWidget
    as TuiBarArray bars
    as int32 barWidth, barGap
    as boolean horizontal, showLabels
    as TuiStyle labelStyle
end type

Description

Labelled bars, vertical or horizontal. Scaled to the largest value present.

Example

#import "std/tui"
using tui

dim as TuiScreen scr
scr.Resize( 30, 8 )
dim as TuiFrame ptr f = scr.BeginFrame( )

dim as TuiBarChart bc
for i as int32 = 0 to 3
    dim as TuiBar b
    b.label = chr( asc( "a" ) + i )
    b.value = ( i + 1 ) * 10.0
    b.color = TuiRgb( 90, 200, 90 )
    bc.bars.Push( b )
next
bc.barWidth = 3 : bc.barGap = 1
bc.showLabels = TRUE
bc.Render( *f, f->Area( ) )
print bc.bars.Count( )            '' 4

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