Skip to content

Commit

Permalink
Added charts.js and charts section
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-zip committed Oct 20, 2023
1 parent 6e545e3 commit 169e791
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 100 deletions.
64 changes: 64 additions & 0 deletions maid_ui/src/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ section {
background: linear-gradient(166deg, rgba(255, 0, 172, 1) 0%, rgba(179, 92, 250, 1) 34%, rgba(171, 0, 255, 1) 53%, rgba(193, 111, 204, 1) 67%, rgba(255, 192, 0, 1) 100%);
}

.center {
display: flex;
justify-content: center;
}

.end {
display: flex;
justify-content: right;
}

.start {
display: flex;
justify-content: left;
}

body {
background-color: var(--raisin-body);
}
Expand Down Expand Up @@ -252,6 +267,55 @@ body {
height: 24px;
}

/* about */

.about-img {
display: flex;
justify-content: center;
align-content: center;
}

.about-img img {
width: 400px;
}

.about-text {
padding: 10px;
text-align: justify;
}

/* loading */

.loading-card {
text-align: center;
background-color: var(--raisin-body);
padding: 20px;
border-radius: 10px;
font-weight: bold;
margin: 10px;
height: 250px;
}

.loading-card-compact {
width: 250px;
}

.pacman-img {}

.loading-text {}

/* grid */

.grid-6-1 {
display: grid;
grid-template-columns: 6fr 1fr;
}

.grid-4x {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* toggle */

#logs,
Expand Down
Binary file added maid_ui/src/assets/img/pacman.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions maid_ui/src/assets/js/chart.min.js

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions maid_ui/src/assets/js/charts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(async function () {
const data = [
{ year: 2010, count: 10 },
{ year: 2011, count: 20 },
{ year: 2012, count: 15 },
{ year: 2013, count: 25 },
{ year: 2014, count: 22 },
{ year: 2015, count: 30 },
{ year: 2016, count: 28 },
];

new Chart(
document.getElementById('acquisitions'),
{
type: 'bar',
data: {
labels: data.map(row => row.year),
datasets: [
{
label: 'Acquisitions by year',
data: data.map(row => row.count)
}
]
}
}
);
})();
Loading

0 comments on commit 169e791

Please sign in to comment.