[+] Display no data

This commit is contained in:
Azalea
2024-03-05 03:21:49 -05:00
parent 67b29851ea
commit 666fbe8ce7

View File

@@ -75,6 +75,9 @@
<div class="trend"> <div class="trend">
<!-- ChartJS cannot be fully responsive unless there is a parent div that's independent from its size and helps it determine its size --> <!-- ChartJS cannot be fully responsive unless there is a parent div that's independent from its size and helps it determine its size -->
<div class="chartjs-box-reference"> <div class="chartjs-box-reference">
{#if d.trend.length === 0}
<div class="no-data">No data in the past 60 days</div>
{:else}
<Line data={{ <Line data={{
datasets: [ datasets: [
{ {
@@ -87,6 +90,7 @@
} }
] ]
}} options={CHARTJS_OPT} /> }} options={CHARTJS_OPT} />
{/if}
</div> </div>
</div> </div>
@@ -282,6 +286,13 @@ $gap: 20px
> .chartjs-box-reference > .chartjs-box-reference
position: absolute position: absolute
inset: 0 inset: 0
display: flex
align-items: center
justify-content: center
.no-data
opacity: 0.5
user-select: none
@media (max-width: $w-mobile) @media (max-width: $w-mobile)
flex-direction: column flex-direction: column