Skip to content

Commit 7efd3c4

Browse files
committed
bar chart
1 parent e3da008 commit 7efd3c4

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

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

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -525,19 +525,33 @@
525525
{@render cost("Mechanical")}
526526
{@render cost("Electrical")}
527527

528-
<section class="flex flex-row gap-4 w-min p-4" style:min-height="20rem" style:background-color="darkgray">
529-
{#snippet bar(team: string)}
530-
<div class="flex flex-col">
531-
<div class="flex flex-col justify-end flex-grow">
532-
<div style:background-color="darkred" style:height={`calc(100% * ${expenditures[team] / maxExpenditure})`}>
528+
<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})`}>
532+
<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+
</div>
535+
{/each}
536+
537+
{#snippet bar(team: string)}
538+
<div class="flex flex-col" style:z-index=1>
539+
<div class="flex flex-col justify-end flex-grow items-center">
540+
<div style:background-color="darkred" style:height={`calc(100% * ${expenditures[team] / maxExpenditure})`} style:width="3rem">
541+
</div>
533542
</div>
543+
<!-- <p>{team}</p> -->
534544
</div>
535-
<p>{team}</p>
536-
</div>
537-
{/snippet}
538-
{@render bar("Software")}
539-
{@render bar("Mechanical")}
540-
{@render bar("Electrical")}
545+
{/snippet}
546+
{@render bar("Software")}
547+
{@render bar("Mechanical")}
548+
{@render bar("Electrical")}
549+
</div>
550+
<div class="ml-14 flex flex-row gap-4">
551+
<p>Software</p>
552+
<p>Mechanical</p>
553+
<p>Electrical</p>
554+
</div>
541555
</section>
542556
{/if}
543557
</section>

0 commit comments

Comments
 (0)