mirror of
https://github.com/seigler/cryptohistory.org
synced 2025-07-26 01:06:12 +00:00
🐛 Fix chart data timespan bug
This commit is contained in:
parent
385f6496b5
commit
e6bf4b8e03
1 changed files with 5 additions and 6 deletions
|
@ -116,7 +116,7 @@ function renderChart(
|
|||
/* day, hour, minute */
|
||||
'1y'=> [
|
||||
'resolution' => 'day',
|
||||
'limit' => 365,
|
||||
'limit' => 52,
|
||||
'aggregate' => 7,
|
||||
'cacheTimeSeconds' => 7 * 24 * 60 * 60
|
||||
],
|
||||
|
@ -128,13 +128,13 @@ function renderChart(
|
|||
],
|
||||
'7d'=> [
|
||||
'resolution' => 'hour',
|
||||
'limit' => 7 * 24,
|
||||
'limit' => 7 * 24 / 4,
|
||||
'aggregate' => 4,
|
||||
'cacheTimeSeconds' => 4 * 24 * 60 * 60
|
||||
'cacheTimeSeconds' => 4 * 60 * 60
|
||||
],
|
||||
'24h' => [
|
||||
'resolution' => 'minute',
|
||||
'limit' => 24 * 60,
|
||||
'limit' => 24 * 60 / 15,
|
||||
'aggregate' => 15,
|
||||
'cacheTimeSeconds' => 15 * 60
|
||||
]
|
||||
|
@ -181,8 +181,7 @@ function renderChart(
|
|||
$cryptocompareJson = CacheManager::get($dataCacheKey);
|
||||
|
||||
if(is_null($cryptocompareJson)) {
|
||||
$cryptocompareJson = getJson('https://min-api.cryptocompare.com/data/histo'.
|
||||
"$resolution?fsym=$currencyA&tsym=$currencyB&limit=$limit&aggregate=$aggregate");
|
||||
$cryptocompareJson = getJson("https://min-api.cryptocompare.com/data/histo$resolution?fsym=$currencyA&tsym=$currencyB&limit=$limit&aggregate=$aggregate");
|
||||
|
||||
if ($cryptocompareJson->Response == 'Error') {
|
||||
CacheManager::set($dataCacheKey, $cryptocompareJson, 60);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue