From 1a7decb91daa87a857dacd22dc93d6d8ae59f489 Mon Sep 17 00:00:00 2001 From: Miguel Medeiros Date: Thu, 26 Aug 2021 23:29:39 -0300 Subject: [PATCH] Add default data to title tooltip `MM/dd HH:mm`. Add symbol to tx chart tooltip . --- .../incoming-transactions-graph.component.ts | 12 +++--------- .../mempool-graph/mempool-graph.component.ts | 8 +------- 2 files changed, 4 insertions(+), 16 deletions(-) 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 e5951c261..0e43bfbb6 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 @@ -68,7 +68,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 80; return obj; }, - extraCssText: `width: ${(['2h', '24h'].includes(this.windowPreference) || this.size === 'small') ? '105px' : '135px'}; + extraCssText: `width: ${(['2h', '24h'].includes(this.windowPreference) || this.size === 'small') ? '125px' : '135px'}; background: transparent; border: none; box-shadow: none;`, @@ -83,7 +83,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { itemFormatted += `
${colorSpan(item.color)}
-
${item.value}
+
${item.value} vB/s
`; } }); @@ -92,13 +92,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges { }, xAxis: { type: 'category', - data: this.data.labels.map((value: any) => { - if (['2h', '24h'].includes(this.windowPreference) || this.size === 'small') { - return formatDate(value, 'HH:mm', this.locale); - } else { - return formatDate(value, 'MM/dd - HH:mm', this.locale); - } - }), + data: this.data.labels.map((value: any) => formatDate(value, 'MM/dd - HH:mm', this.locale)), }, yAxis: { type: 'value', 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 f6e7761fe..f7df31fb2 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -204,13 +204,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges { type: 'category', boundaryGap: false, axisLine: { onZero: false }, - data: labels.map((value: any) => { - if (['2h', '24h'].includes(this.windowPreference) || this.size === 'small') { - return formatDate(value, 'HH:mm', this.locale); - } else { - return formatDate(value, 'MM/dd - HH:mm', this.locale); - } - }), + data: labels.map((value: any) => formatDate(value, 'MM/dd - HH:mm', this.locale)), } ], yAxis: {