Changeset e9cfa3c in Klonkt


Ignore:
Timestamp:
06/19/2026 07:26:39 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
9b3e12c
Parents:
6b8afb1
Message:

fix: stats chart overflowed the card at 90 days

90 day columns + all date labels didn't fit → overflow to the right outside the card.
Now: columns shrink (flex 1 1 0 + min-width:0), chart overflow:hidden within the
card, and date labels thinned out (14d every one, 30d every 4th, 90d every 10th).

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/admin-stats.ejs

    r6b8afb1 re9cfa3c  
    3535    </div>
    3636    <div class="stats-chart">
    37       <% s.series.forEach(function(d){
     37      <% var _step = s.days <= 14 ? 1 : (s.days <= 31 ? 4 : 10);
     38         s.series.forEach(function(d, i){
    3839           var pvPct = Math.round(d.pageviews / _max * 100);
    3940           var visPct = Math.round(d.visitors / _max * 100);
     
    4445            <span class="sc-vis" style="height: <%= visPct %>%"></span>
    4546          </div>
    46           <span class="sc-day"><%= d.day.slice(8) %></span>
     47          <span class="sc-day"><%= (i % _step === 0) ? d.day.slice(8) : '' %></span>
    4748        </div>
    4849      <% }); %>
     
    116117.lg-vis::before { background: var(--accent); }
    117118.lg-pv::before { background: color-mix(in srgb, var(--accent) 28%, transparent); }
    118 .stats-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; margin-top: 1rem; }
    119 .sc-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
    120 .sc-bar { position: relative; width: 70%; max-width: 26px; height: 140px; display: flex; align-items: flex-end; }
     119.stats-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; margin-top: 1rem; overflow: hidden; }
     120.sc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
     121.sc-bar { position: relative; width: 70%; max-width: 26px; min-width: 2px; height: 140px; display: flex; align-items: flex-end; }
     122.sc-day { white-space: nowrap; }
    121123.sc-pv, .sc-vis { position: absolute; bottom: 0; left: 0; width: 100%; border-radius: 3px 3px 0 0; min-height: 2px; }
    122124.sc-pv { background: color-mix(in srgb, var(--accent) 28%, transparent); }
Note: See TracChangeset for help on using the changeset viewer.