Add base fee to the chart

This commit is contained in:
Willian Mitsuda 2021-08-03 23:32:36 -03:00
parent e7bbf5dce5
commit b5e16dd410
1 changed files with 18 additions and 0 deletions

View File

@ -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
}
],
});