Skip to content

Commit 9fb7032

Browse files
Merge pull request #1699 from Aarsh30/budget
Adding the budget Manager
2 parents 5a3f75e + 2a8bbf5 commit 9fb7032

39 files changed

Lines changed: 2266 additions & 0 deletions

Projects/Budget Manager/app.js

Lines changed: 596 additions & 0 deletions
Large diffs are not rendered by default.
75.1 KB
Loading

Projects/Budget Manager/chart.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
var chart = document.querySelector(".chart");
2+
// Crating canvas element
3+
const canvas = document.createElement("canvas");
4+
// to draw our canvas ,we need to get context of canvas
5+
const ctx = canvas.getContext("2d");
6+
7+
canvas.width = 150;
8+
canvas.height = 150;
9+
10+
// Append canvas to chart element
11+
chart.appendChild(canvas);
12+
13+
// change line width
14+
ctx.lineWidth = 16;
15+
16+
// circle radius
17+
const R = 60;
18+
19+
function drawCircle(color, ratio, anticlockwise) {
20+
ctx.strokeStyle = color;
21+
ctx.beginPath();
22+
ctx.arc(
23+
canvas.width / 2,
24+
canvas.height / 2,
25+
R,
26+
0,
27+
ratio * 2 * Math.PI,
28+
anticlockwise
29+
);
30+
ctx.stroke();
31+
}
32+
33+
function updateChart(income, expense) {
34+
let ratio = income / (income + expense);
35+
36+
drawCircle("#28B9B5", -ratio, true);
37+
drawCircle("#e66767", 1 - ratio, false);
38+
}
39+
40+
updateChart(0, 0);
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

Projects/Budget Manager/debug.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[0412/123006.787:ERROR:file_io_win.cc(179)] CreateFile C:\Program Files (x86)\Google\Chrome\settings.dat: Access is denied. (0x5)
2+
[0412/123006.787:ERROR:registration_protocol_win.cc(84)] TransactNamedPipe: The pipe has been ended. (0x6D)
3+
[0412/123006.804:ERROR:file_io_win.cc(179)] CreateFile C:\Program Files (x86)\Google\Chrome\settings.dat: Access is denied. (0x5)
4+
[0422/215112.814:ERROR:file_io_win.cc(179)] CreateFile C:\Program Files (x86)\Google\Chrome\settings.dat: Access is denied. (0x5)
5+
[0422/215112.850:ERROR:registration_protocol_win.cc(84)] TransactNamedPipe: The pipe has been ended. (0x6D)
6+
[0422/215112.852:ERROR:file_io_win.cc(179)] CreateFile C:\Program Files (x86)\Google\Chrome\settings.dat: Access is denied. (0x5)
61 KB
Binary file not shown.
55.5 KB
Binary file not shown.
62.6 KB
Binary file not shown.
63 KB
Binary file not shown.

0 commit comments

Comments
 (0)