From 28d3f190ff23cf0a7a9f2c784f468e8ec48dfa3c Mon Sep 17 00:00:00 2001 From: nymkappa Date: Tue, 14 Dec 2021 16:33:17 +0900 Subject: [PATCH] Update graph tick intervals - Hide label in zoom component - Show hour on 1y graphs --- backend/src/api/statistics.ts | 4 ++-- .../incoming-transactions-graph.component.ts | 1 + .../app/components/mempool-graph/mempool-graph.component.ts | 1 + frontend/src/app/shared/graphs.utils.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 2613ca676..d1784f937 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -446,7 +446,7 @@ class Statistics { public async $list6M(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDaysAvg(28800, '6 MONTH'); // 8h interval + const query = this.getQueryForDaysAvg(21600, '6 MONTH'); // 6h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); @@ -459,7 +459,7 @@ class Statistics { public async $list1Y(): Promise { try { const connection = await DB.pool.getConnection(); - const query = this.getQueryForDays(54000, '1 YEAR'); // 15h interval + const query = this.getQueryForDays(43200, '1 YEAR'); // 12h interval const [rows] = await connection.query({ sql: query, timeout: this.queryTimeout }); connection.release(); return this.mapStatisticToOptimizedStatistic(rows); diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts index 2f4404249..4f982a269 100644 --- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts +++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts @@ -74,6 +74,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { maxSpan: 100, minSpan: 10, }, { + showDetail: false, show: (this.template === 'advanced') ? true : false, type: 'slider', brushSelect: false, diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts index 75175c1a5..35dacbe26 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -289,6 +289,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { maxSpan: 100, minSpan: 10, }, { + showDetail: false, show: (this.template === 'advanced' && this.showZoom) ? true : false, type: 'slider', brushSelect: false, diff --git a/frontend/src/app/shared/graphs.utils.ts b/frontend/src/app/shared/graphs.utils.ts index 0380fa964..51f3b3f3f 100644 --- a/frontend/src/app/shared/graphs.utils.ts +++ b/frontend/src/app/shared/graphs.utils.ts @@ -19,8 +19,8 @@ export const formatterXAxis = ( case '1m': case '3m': case '6m': - return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' }); case '1y': + return date.toLocaleTimeString(locale, { month: 'short', day: 'numeric', hour: 'numeric' }); case '2y': case '3y': return date.toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' });