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:
Name | Type | Description |
---|---|---|
style | PhpTui\Tui\Style\Style | |
data | list<int<0, max>> | |
max | int<0, max> | |
direction | PhpTui\Tui\Extension\Core\Widget\Sparkline\RenderDirection |