Initial commit, console stuff works
This commit is contained in:
25
examples/basic.php
Normal file
25
examples/basic.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
$histogram = new NoccyLabs\Histogram\Output\TerminalHistogram(40);
|
||||
$buffer = $histogram->getBuffer();
|
||||
|
||||
for ($n = 0; $n<40; $n++) {
|
||||
$s = sin($n/5) + 1;
|
||||
$buffer->pushSamples($s);
|
||||
}
|
||||
|
||||
//$buffer->pushSamples(0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.5, 0.7, 0.9, 1.0, 1.1, 1.5, 1.0, 0.9, 0.7, null, 0.4, null, 0.3);
|
||||
|
||||
|
||||
|
||||
echo $histogram . "\n\n";
|
||||
|
||||
echo join("\n", $histogram->getMultiHistogram(3)) . "\n\n";
|
||||
|
||||
$histogram->setMax(2.0);
|
||||
echo join("\n", $histogram->getMultiHistogram(3)) . "\n\n";
|
||||
|
||||
$histogram->setMax(5.0);
|
||||
echo join("\n", $histogram->getMultiHistogram(3)) . "\n\n";
|
Reference in New Issue
Block a user