From 5e4e6277c8ccb6338b65389bbd9b9090e271914c Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Tue, 7 Feb 2017 11:46:41 -0500 Subject: [PATCH] feat: add "filled" chart type --- index.php | 2 +- views/chart.php | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index b3253be..ca4d272 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,7 @@ $router->map('GET', '/', function() { }); // map cryptocurrency stuff -$router->map( 'GET', '/charts/[dark|light|sparkline|candlestick:theme]/[a:curA]-[btc|usdt:curB]/[a:duration]/[svg|png:format]', function($theme, $curA, $curB, $duration, $format) { +$router->map( 'GET', '/charts/[dark|light|sparkline|candlestick|filled:theme]/[a:curA]-[btc|usdt:curB]/[a:duration]/[svg|png:format]', function($theme, $curA, $curB, $duration, $format) { require __DIR__ . '/views/chart.php'; return renderChart( $theme, diff --git a/views/chart.php b/views/chart.php index 89bb7a7..1ee8f86 100644 --- a/views/chart.php +++ b/views/chart.php @@ -102,15 +102,27 @@ function renderChart( 'xAxisEnabled'=>false ], 'candlestick'=>[ - 'width' => 800, - 'height' => 250, - 'barColor' => '#000', - 'risingColor' => '#0D0', - 'fallingColor' => '#D00', - 'labelColor' => '#000', - 'fontSize' => 15, + 'width'=>800, + 'height'=>250, + 'barColor'=>'#000', + 'risingColor'=>'#0D0', + 'fallingColor'=>'#D00', + 'labelColor'=>'#000', + 'fontSize'=>15, 'yAxisEnabled'=>true, 'xAxisEnabled'=>false + ], + 'filled'=>[ + 'width'=>800, + 'height'=>250, + 'lineColor'=>'#000', + 'labelColor'=>'#000', + 'smoothed'=>true, + 'fontSize'=>15, + 'yAxisEnabled'=>true, + 'xAxisEnabled'=>false, + 'yAxisZero'=>true, + 'filled'=>true ] ];