Sparkline

Sparkline #

PhpTui\Tui\Extension\Core\Widget\SparklineWidget

Widget to render a sparkline over one or more lines.

Example #

Show code
<?php

declare(strict_types=1);

use PhpTui\Tui\DisplayBuilder;
use PhpTui\Tui\Extension\Core\Widget\SparklineWidget;

require 'vendor/autoload.php';

$display = DisplayBuilder::default()->build();
$display->draw(
    SparklineWidget::default()
        ->data(1, 6, 10, 3, 5, 8)
);

Parameters #

Configure the widget using the builder methods named as follows:

NameTypeDescription
stylePhpTui\Tui\Style\Style
datalist<int<0, max>>
maxint<0, max>
directionPhpTui\Tui\Extension\Core\Widget\Sparkline\RenderDirection