-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43ee6a9
commit 3b7613c
Showing
7 changed files
with
152 additions
and
9 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
var ctxPie = document.getElementById('transactionTypePieChart').getContext('2d') | ||
var ctxLine = document.getElementById('transactionLineChart').getContext('2d') | ||
|
||
var depositData = JSON.parse('{{ deposit_data|safe }}') | ||
var transferData = JSON.parse('{{ transfer_data|safe }}') | ||
var debitCardData = JSON.parse('{{ debit_card_data|safe }}') | ||
|
||
// Transaction Type Pie Chart | ||
var typePieChartData = { | ||
labels: ['Deposit', 'Transfer', 'Debit Card'], | ||
datasets: [ | ||
{ | ||
label: 'Transaction Type', | ||
backgroundColor: ['blue', 'green', 'red'], | ||
data: [depositData.length, transferData.length, debitCardData.length] | ||
} | ||
] | ||
} | ||
|
||
var typePieChart = new Chart(ctxPie, { | ||
type: 'pie', | ||
data: typePieChartData, | ||
options: { | ||
responsive: true, | ||
plugins: { | ||
legend: { | ||
position: 'right' | ||
}, | ||
title: { | ||
display: true, | ||
text: 'Transaction Type Distribution', | ||
padding: 20 | ||
} | ||
} | ||
} | ||
}) | ||
|
||
var depositDates = depositData.map(function (entry) { | ||
return entry.date | ||
}) | ||
var depositAmounts = depositData.map(function (entry) { | ||
return entry.amount | ||
}) | ||
|
||
var transferDates = transferData.map(function (entry) { | ||
return entry.date | ||
}) | ||
var transferAmounts = transferData.map(function (entry) { | ||
return entry.amount | ||
}) | ||
|
||
var debitCardDates = debitCardData.map(function (entry) { | ||
return entry.date | ||
}) | ||
var debitCardAmounts = debitCardData.map(function (entry) { | ||
return entry.amount | ||
}) | ||
|
||
var myChart = new Chart(ctxLine, { | ||
type: 'line', | ||
data: { | ||
labels: depositDates, | ||
datasets: [ | ||
{ | ||
label: 'Deposit', | ||
data: depositAmounts, | ||
borderColor: 'rgba(75, 192, 192, 1)', | ||
fill: false | ||
}, | ||
{ | ||
label: 'Transfer', | ||
data: transferAmounts, | ||
borderColor: 'rgba(255, 99, 132, 1)', | ||
fill: false | ||
}, | ||
{ | ||
label: 'Debit Card', | ||
data: debitCardAmounts, | ||
borderColor: 'rgba(255, 205, 86, 1)', | ||
fill: false | ||
} | ||
] | ||
}, | ||
options: { | ||
animation: { | ||
easing: 'easeInOutQuad' | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
const addAccount = document.querySelectorAll('.add-account'); | ||
const WelcomeCreateAccountBtn = document.querySelector('#welcome-create-account-btn'); | ||
|
||
WelcomeCreateAccountBtn.addEventListener('click', () => { | ||
addAccount[1].focus() | ||
}) | ||
if (WelcomeCreateAccountBtn) { | ||
WelcomeCreateAccountBtn.addEventListener('click', () => { | ||
addAccount[1].focus() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters