Skip to content

Commit

Permalink
Fix transactions and circulation charts according to tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
kacpersaw committed Jan 3, 2024
1 parent 915950c commit ca69ae3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,16 @@ const Home = () => {
const smeshingRewardChartData = data && data.rewards;

const circulation = data && data.circulation.reduce((accumulator, currentVal) => accumulator + currentVal.amt, 0);
const circulationChartData = data && data.circulation;
const circulationChartData = data && data.circulation.map((obj, index) => {
obj.amt = index > 0 ? obj.amt + data.circulation[index - 1].amt : obj.amt;
return obj;
});

const transactions = data && data.transactions.reduce((accumulator, currentVal) => accumulator + currentVal.amt, 0);
const transactionsChartData = data && data.transactions;
const transactionsChartData = data && data.transactions.map((obj, index) => {
obj.amt = index > 0 ? obj.amt + data.transactions[index - 1].amt : obj.amt;
return obj;
});

const security = data && data.security[data.security.length - 1];
const securityChartData = data && data.security;
Expand Down

0 comments on commit ca69ae3

Please sign in to comment.