From b5e16dd41040fe61658e0268ed2136c999ce60a7 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Tue, 3 Aug 2021 23:32:36 -0300 Subject: [PATCH] Add base fee to the chart --- src/special/london/chart.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/special/london/chart.ts b/src/special/london/chart.ts index 1caf6f3..4d2298d 100644 --- a/src/special/london/chart.ts +++ b/src/special/london/chart.ts @@ -28,6 +28,17 @@ export const options: ChartOptions = { callback: (v) => `${v} Gwei`, }, }, + yBaseFee: { + position: "right", + beginAtZero: true, + title: { + display: true, + text: "Base fee", + }, + grid: { + drawOnChartArea: false + } + }, }, }; @@ -44,5 +55,12 @@ export const toChartData = (blocks: ExtendedBlock[]): ChartData => ({ borderColor: "#F97316", tension: 0.2, }, + { + label: "Base fee (Gwei)", + data: blocks.map(b => b.baseFeePerGas!.toNumber()).reverse(), + yAxisID: "yBaseFee", + borderColor: "#FCA5A5", + tension: 0.2 + } ], });