mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-16 23:02:13 +11:00
maybe this is the right way
This commit is contained in:
parent
5c6844e923
commit
107f97eb67
2 changed files with 4 additions and 4 deletions
6
index.js
6
index.js
|
|
@ -214,12 +214,12 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
|
|||
console.log(graphlog);
|
||||
let graphdata = '["transaction", "balance"]';
|
||||
let currentbal = balance.value;
|
||||
for (i in graphlog) {
|
||||
for (i = graphlog.length - 1; i > -1; i--) {
|
||||
if (graphlog[i].from == req.session.user) {
|
||||
currentbal = parseInt(currentbal) - parseInt(graphlog[i].amount);
|
||||
currentbal = parseInt(currentbal) + parseInt(graphlog[i].amount);
|
||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||
} else {
|
||||
currentbal = parseInt(currentbal) + parseInt(graphlog[i].amount);
|
||||
currentbal = parseInt(currentbal) - parseInt(graphlog[i].amount);
|
||||
graphdata = graphdata + ", [" + parseInt(i) + "," + currentbal + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ block content
|
|||
|
||||
var options = {
|
||||
title: 'Balance',
|
||||
hAxis: {title: 'Transaction', minValue: 0, maxValue: 15, direction: -1, textPosition: 'none'},
|
||||
hAxis: {title: 'Transaction', minValue: 0, maxValue: 15, direction: 1, textPosition: 'none'},
|
||||
vAxis: {title: 'Balance', minValue: 0, maxValue: 500},
|
||||
legend: 'none'
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue