Skip to content

Commit 47c0807

Browse files
committed
update bar chart
1 parent 7efd3c4 commit 47c0807

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

usr-web/src/routes/(apps)/manifest/+page.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
let orders: Order[] = $state([]);
3131
let expenditures: Record<string, number> = $state({});
3232
let maxExpenditure = $state(0);
33+
const costIncrement = 200;
3334
3435
interface OrderStatus {
3536
order_id: number;
@@ -526,11 +527,11 @@
526527
{@render cost("Electrical")}
527528

528529
<section class="flex flex-col w-min" style:background-color="darkgray">
529-
<div class="relative flex flex-row gap-10 w-min pt-8 pr-8 pl-16" style:min-height="20rem">
530-
{#each { length: Math.floor(maxExpenditure / 100) + 1 } as _, i}
531-
<div class="absolute flex flex-row" style:width={"calc(100% - 4rem)"} style:right="1rem" style:bottom={`calc((100% - 2rem) * ${i*100 / maxExpenditure})`}>
530+
<div class="relative flex flex-row gap-10 w-min pt-8 pr-8 pl-20" style:min-height="20rem">
531+
{#each { length: Math.floor(maxExpenditure / costIncrement) + 1 } as _, i}
532+
<div class="absolute flex flex-row" style:width={"calc(100% - 5rem)"} style:right="1rem" style:bottom={`calc((100% - 2rem) * ${i*costIncrement / maxExpenditure})`}>
532533
<div class="w-full border-t-2 border-black"></div>
533-
<p class="absolute mr-2" style:bottom="-0.75rem" style:right="100%">${i * 100}</p>
534+
<p class="absolute mr-2" style:bottom="-0.75rem" style:right="100%">${i * costIncrement}</p>
534535
</div>
535536
{/each}
536537

@@ -540,14 +541,13 @@
540541
<div style:background-color="darkred" style:height={`calc(100% * ${expenditures[team] / maxExpenditure})`} style:width="3rem">
541542
</div>
542543
</div>
543-
<!-- <p>{team}</p> -->
544544
</div>
545545
{/snippet}
546546
{@render bar("Software")}
547547
{@render bar("Mechanical")}
548548
{@render bar("Electrical")}
549549
</div>
550-
<div class="ml-14 flex flex-row gap-4">
550+
<div class="flex flex-row gap-4" style:margin-left="4.5rem">
551551
<p>Software</p>
552552
<p>Mechanical</p>
553553
<p>Electrical</p>

0 commit comments

Comments
 (0)