From 9e83c583d8c974f63406c210b029ff05625aacf1 Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Mon, 27 Jun 2016 22:35:47 -0400 Subject: [PATCH] better testing pages --- testing.php => test-stockMarket.php | 14 +++++++----- test-temperature.php | 34 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) rename testing.php => test-stockMarket.php (53%) create mode 100644 test-temperature.php diff --git a/testing.php b/test-stockMarket.php similarity index 53% rename from testing.php rename to test-stockMarket.php index 8938183..8d8345e 100644 --- a/testing.php +++ b/test-stockMarket.php @@ -8,7 +8,6 @@ hammering Poloniex half to death. */ - ini_set('display_errors', 1); //include 'buffer.php'; @@ -20,12 +19,15 @@ spl_autoload_register(function ($class_name) { $chartData = []; -$start = 0.01;// * rand()/getRandMax(); -$volatility = 0.002; +$offset = 100 * (rand()/getRandMax())**4; +$scale = 100 * (rand()/getRandMax())**4; +$volatility = 0.5 * (rand()/getRandMax())**3; -for ($n = 0, $current = $start; $n < 50; $n++) { - $current += $volatility * (rand()/getRandMax() - 0.5)**3; +for ($n = 0, $current = $offset + 0.5 * $scale; $n < 96; $n++) { + $current -= $offset; + $current *= 1 + $volatility * (rand()/getRandMax() - 0.5); + $current += $offset; $chartData[$n] = $current; } -print SVGChartBuilder::renderStockChart($chartData); +print SVGChartBuilder::renderStockChart($chartData, 1000, "#708", "#777", false); diff --git a/test-temperature.php b/test-temperature.php new file mode 100644 index 0000000..723955f --- /dev/null +++ b/test-temperature.php @@ -0,0 +1,34 @@ +