Animated Charts, Infographics and Flow Diagrams in SVG

Updated 2026-10-16. 8 effects.

An animated chart draws its data in once it is on screen: bars grow from the axis, a line traces from left to right, a donut fills to its share. Build it as inline SVG, grow bars with scaleY or scaleX, draw lines and arcs with stroke-dashoffset, and keep every figure as real text.

The animation is there to show the shape of the data once, then get out of the way. Each chart here plays when it scrolls into view and settles on a normal static chart. A chart that keeps moving makes values harder to read.

Every chart carries its numbers as text: axis labels, a value on each bar, a caption, and a visually hidden table or list for screen readers. The demo figures are for invented small businesses and are clearly sample data; change the arrays at the top of each piece to plot your own.

Flow diagrams use the same tools in a different way: dashed connector lines whose offset moves to show direction, and nodes that light in sequence. They suit explaining a process, such as how an order travels from shop to door.

Compare them

EffectBuilt withSize (gzipped)Running costBrowser support
Bakery Weekly Sales Bar ChartCSS only3.3 KBSeven bars scale on the compositor and seven labels fade, all done in about 1.2 seconds, then the card is still.All current browsers
Café Orders by Channel Donut ChartCSS only3.3 KBFour circle strokes repaint briefly as they fill in sequence over about 1.3 seconds, then the chart holds still.All current browsers
Community Garden Season InfographicCSS only3.1 KBTen short icon strokes repaint as they draw and six text blocks fade, finished in about 1.4 seconds.All current browsers
Revenue Share Stacked Area ChartCSS only3.6 KBThree filled shapes fade in by opacity and twelve labels follow, all within about 1.5 seconds; after that nothing repaints.All current browsers
Restoration Timeline With Stages Lighting UpCSS only3.3 KBOne line scales and five nodes and labels fade on the compositor over about 1.5 seconds, then nothing moves.All current browsers
Garden Shop Orders Line Chart That DrawsCSS only3.7 KBOne path repaints while it draws for just over a second, and eight dots and labels fade on the compositor; then the card is static.All current browsers
Order Flow Diagram With Moving LinesCSS only3.4 KBThree short dashed lines repaint as their pattern slides, which is light, and the loop pauses with animation-play-state when the diagram leaves the screen.All current browsers
Class Bookings Ranked as Horizontal BarsCSS only3.2 KBFive bars scale and five numbers fade on the compositor in just over a second; after that nothing runs.All current browsers

Bakery Weekly Sales Bar Chart

A weekly sales card for a bakery's owner report. Seven bars rise from the axis one after another, Saturday's in terracotta, and each day's loaf count fades in above its bar as it lands. The bars are plain elements grown with scaleY from their bottom edge, so the card can sit in any page layout and still read on a phone.

<section class="m6bar">
<div class="m6bar-card">
  <div class="m6bar-head">
    <p class="m6bar-eyebrow">Fennel &amp; Rye Bakery · Week 11</p>
    <h2 class="m6bar-h">Loaves sold each day</h2>
    <p class="m6bar-lede">Saturday is the busiest day of the week at 168 loaves, double a quiet Monday.</p>
  </div>
  <figure class="m6bar-fig">
    <div class="m6bar-plot" role="img" aria-label="Bar chart of loaves sold each day in week 11. Saturday is highest at 168 and Monday lowest at 84.">
      <div class="m6bar-grid" aria-hidden="true">
        <span class="m6bar-g50"><b>50</b></span>
        <span class="m6bar-g100"><b>100</b></span>
        <span class="m6bar-g150"><b>150</b></span>
      </div>
      <div class="m6bar-cols">
      <div class="m6bar-col m6bar-c0">
        <span class="m6bar-val m6bar-f m6bar-t5">84</span>
        <span class="m6bar-bar m6bar-gy m6bar-t0"></span>
      </div>
      <div class="m6bar-col m6bar-c1">
        <span class="m6bar-val m6bar-f m6bar-t6">92</span>
        <span class="m6bar-bar m6bar-gy m6bar-t1"></span>
      </div>
      <div class="m6bar-col m6bar-c2">
        <span class="m6bar-val m6bar-f m6bar-t7">88</span>
        <span class="m6bar-bar m6bar-gy m6bar-t2"></span>
      </div>
      <div class="m6bar-col m6bar-c3">
        <span class="m6bar-val m6bar-f m6bar-t8">104</span>
        <span class="m6bar-bar m6bar-gy m6bar-t3"></span>
      </div>
      <div class="m6bar-col m6bar-c4">
        <span class="m6bar-val m6bar-f m6bar-t9">131</span>
        <span class="m6bar-bar m6bar-gy m6bar-t4"></span>
      </div>
      <div class="m6bar-col m6bar-c5 m6bar-top">
        <span class="m6bar-val m6bar-f m6bar-t10">168</span>
        <span class="m6bar-bar m6bar-gy m6bar-t5"></span>
      </div>
      <div class="m6bar-col m6bar-c6">
        <span class="m6bar-val m6bar-f m6bar-t11">117</span>
        <span class="m6bar-bar m6bar-gy m6bar-t6"></span>
      </div>
      </div>
    </div>
    <div class="m6bar-days" aria-hidden="true">
      <span>Mon</span>
      <span>Tue</span>
      <span>Wed</span>
      <span>Thu</span>
      <span>Fri</span>
      <span>Sat</span>
      <span>Sun</span>
    </div>
    <ul class="m6bar-sr">
      <li>Monday: 84 loaves</li>
      <li>Tuesday: 92 loaves</li>
      <li>Wednesday: 88 loaves</li>
      <li>Thursday: 104 loaves</li>
      <li>Friday: 131 loaves</li>
      <li>Saturday: 168 loaves</li>
      <li>Sunday: 117 loaves</li>
    </ul>
    <figcaption class="m6bar-cap">Sample figures for an invented bakery. Whole loaves only, rolls not counted.</figcaption>
  </figure>
</div>
<button type="button" class="m6bar-replay" aria-label="Replay the chart"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the bar and highlight colours at the top of .m6bar, the --v value on each .m6bar-c rule, and --m6bar-unit (pixels per loaf). */
.m6bar { --m6bar-bg: #efe8dc; --m6bar-card: #fbf8f2; --m6bar-ink: #2a241d; --m6bar-quiet: #635a4e; --m6bar-line: #ddd3c3; --m6bar-focus: #2a241d; --m6bar-bar: #d8c3a2; --m6bar-hi: #a94f2c; --m6bar-unit: 1.25px; }
.m6bar { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6bar *, .m6bar *::before, .m6bar *::after { box-sizing: border-box; }
.m6bar svg { display: block; overflow: visible; }
.m6bar-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6bar-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6bar-line); border-radius: 999px; background: transparent; color: var(--m6bar-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6bar-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6bar-replay:hover { color: var(--m6bar-ink); }
.m6bar-replay:focus-visible { outline: 2px solid var(--m6bar-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6bar.is-js:not([data-run]) .m6bar-gy { transform: scaleY(0); }
  .m6bar.is-js:not([data-run]) .m6bar-gx { transform: scaleX(0); }
  .m6bar.is-js:not([data-run]) .m6bar-f { opacity: 0; }
  .m6bar.is-js:not([data-run]) .m6bar-o { opacity: 0; }
  .m6bar.is-js:not([data-run]) .m6bar-d { stroke-dashoffset: var(--m6bar-len, 1); }
  .m6bar.is-js:not([data-run]) .m6bar-pop { opacity: 0; }
}
.m6bar[data-run] .m6bar-gy { animation: m6bar-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6bar[data-run] .m6bar-gx { animation: m6bar-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6bar[data-run] .m6bar-f { animation: m6bar-f .45s ease-out both; }
.m6bar[data-run] .m6bar-o { animation: m6bar-o .6s ease-out both; }
.m6bar[data-run] .m6bar-d { animation: m6bar-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6bar[data-run] .m6bar-pop { animation: m6bar-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6bar-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6bar-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6bar-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6bar-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6bar-d { from { stroke-dashoffset: var(--m6bar-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6bar-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6bar[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6bar *, .m6bar *::before, .m6bar *::after { animation: none !important; transition: none !important; }
  .m6bar-replay { display: none; }
}

.m6bar { background: var(--m6bar-bg); color: var(--m6bar-ink); padding: 48px clamp(16px, 4vw, 48px) 80px; }
.m6bar-card { max-width: 760px; margin: 0 auto; padding: 32px clamp(18px, 4vw, 40px) 26px; background: var(--m6bar-card); border: 1px solid var(--m6bar-line); border-radius: 14px; box-shadow: 0 1px 0 rgba(42, 36, 29, .04), 0 28px 50px -36px rgba(42, 36, 29, .5); }
.m6bar-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6bar-quiet); }
.m6bar-h { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(26px, 3.4vw, 34px); line-height: 1.1; letter-spacing: -.01em; }
.m6bar-lede { margin: 10px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--m6bar-quiet); max-width: 34em; }
.m6bar-fig { margin: 28px 0 0; }
.m6bar-plot { position: relative; height: calc(200 * var(--m6bar-unit)); padding-left: 34px; border-bottom: 1.5px solid var(--m6bar-ink); }
.m6bar-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--m6bar-line); }
.m6bar-grid b { position: absolute; left: 0; top: -9px; font-size: 11.5px; font-weight: 500; color: var(--m6bar-quiet); }
.m6bar-g50 { bottom: calc(50 * var(--m6bar-unit)); }
.m6bar-g100 { bottom: calc(100 * var(--m6bar-unit)); }
.m6bar-g150 { bottom: calc(150 * var(--m6bar-unit)); }
.m6bar-cols { position: relative; height: 100%; display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 2vw, 18px); align-items: end; }
.m6bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.m6bar-val { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--m6bar-quiet); }
.m6bar-bar { display: block; width: 100%; max-width: 64px; height: calc(var(--v) * var(--m6bar-unit)); background: var(--m6bar-bar); border-radius: 5px 5px 0 0; transform-origin: 50% 100%; }
.m6bar-top .m6bar-bar { background: var(--m6bar-hi); }
.m6bar-top .m6bar-val { color: var(--m6bar-hi); font-size: 15px; font-weight: 700; }
.m6bar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 2vw, 18px); padding-left: 34px; margin-top: 8px; font-size: 13px; color: var(--m6bar-quiet); text-align: center; }
.m6bar-cap { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--m6bar-line); font-size: 12.5px; color: var(--m6bar-quiet); padding-right: 96px; }
@media (max-width: 560px) {
  .m6bar { --m6bar-unit: 1px; }
  .m6bar-plot, .m6bar-days { padding-left: 26px; }
  .m6bar-val { font-size: 11.5px; }
  .m6bar-top .m6bar-val { font-size: 13px; }
  .m6bar-days { font-size: 12px; }
}
.m6bar-c0 { --v: 84; }
.m6bar-c1 { --v: 92; }
.m6bar-c2 { --v: 88; }
.m6bar-c3 { --v: 104; }
.m6bar-c4 { --v: 131; }
.m6bar-c5 { --v: 168; }
.m6bar-c6 { --v: 117; }
.m6bar[data-run] .m6bar-t0 { animation-delay: 0.00s; }
.m6bar[data-run] .m6bar-t1 { animation-delay: 0.07s; }
.m6bar[data-run] .m6bar-t2 { animation-delay: 0.14s; }
.m6bar[data-run] .m6bar-t3 { animation-delay: 0.21s; }
.m6bar[data-run] .m6bar-t4 { animation-delay: 0.28s; }
.m6bar[data-run] .m6bar-t5 { animation-delay: 0.35s; }
.m6bar[data-run] .m6bar-t6 { animation-delay: 0.42s; }
.m6bar[data-run] .m6bar-t7 { animation-delay: 0.49s; }
.m6bar[data-run] .m6bar-t8 { animation-delay: 0.56s; }
.m6bar[data-run] .m6bar-t9 { animation-delay: 0.63s; }
.m6bar[data-run] .m6bar-t10 { animation-delay: 0.70s; }
.m6bar[data-run] .m6bar-t11 { animation-delay: 0.77s; }
.m6bar[data-run] .m6bar-t12 { animation-delay: 0.84s; }
.m6bar[data-run] .m6bar-t13 { animation-delay: 0.91s; }
.m6bar[data-run] .m6bar-t14 { animation-delay: 0.98s; }
.m6bar[data-run] .m6bar-t15 { animation-delay: 1.05s; }
.m6bar[data-run] .m6bar-t16 { animation-delay: 1.12s; }
.m6bar[data-run] .m6bar-t17 { animation-delay: 1.19s; }
.m6bar[data-run] .m6bar-t18 { animation-delay: 1.26s; }
.m6bar[data-run] .m6bar-t19 { animation-delay: 1.33s; }
.m6bar[data-run] .m6bar-t20 { animation-delay: 1.40s; }
.m6bar[data-run] .m6bar-t21 { animation-delay: 1.47s; }
.m6bar[data-run] .m6bar-t22 { animation-delay: 1.54s; }
.m6bar[data-run] .m6bar-t23 { animation-delay: 1.61s; }
.m6bar[data-run] .m6bar-t24 { animation-delay: 1.68s; }
.m6bar[data-run] .m6bar-t25 { animation-delay: 1.75s; }
.m6bar[data-run] .m6bar-t26 { animation-delay: 1.82s; }
.m6bar[data-run] .m6bar-t27 { animation-delay: 1.89s; }
.m6bar[data-run] .m6bar-t28 { animation-delay: 1.96s; }
.m6bar[data-run] .m6bar-t29 { animation-delay: 2.03s; }
.m6bar[data-run] .m6bar-t30 { animation-delay: 2.10s; }
.m6bar[data-run] .m6bar-t31 { animation-delay: 2.17s; }
.m6bar[data-run] .m6bar-t32 { animation-delay: 2.24s; }
.m6bar[data-run] .m6bar-t33 { animation-delay: 2.31s; }
.m6bar[data-run] .m6bar-t34 { animation-delay: 2.38s; }
.m6bar[data-run] .m6bar-t35 { animation-delay: 2.45s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6bar").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6bar-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: All seven bars stand at their values with every count visible from the start.

Running cost: Seven bars scale on the compositor and seven labels fade, all done in about 1.2 seconds, then the card is still.

  • Set each day's value with the `--v` number on its `.m6bar-c` rule and the matching text in the bar label and hidden list.
  • Change `--m6bar-unit` to make the chart taller or shorter; the gridlines follow it.
  • Pick the standout colour with `--m6bar-hi` and the other bars with `--m6bar-bar`.

Café Orders by Channel Donut Chart

A monthly channel card for a café, set on deep navy. The four segments of the donut fill one after another around the ring, each circle drawn with pathLength 100 so its dash equals its share, and the legend rows fade in as their segment lands. The headline share sits in the centre as real text.

<section class="m6dnt">
<div class="m6dnt-card">
  <figure class="m6dnt-fig">
    <div class="m6dnt-chart" role="img" aria-label="Donut chart of orders by channel in May. Counter 46%, order ahead 27%, delivery 19% and catering 8%.">
      <svg class="m6dnt-svg" viewBox="0 0 200 200" aria-hidden="true" focusable="false">
        <circle class="m6dnt-track" cx="100" cy="100" r="78"/>
        <circle class="m6dnt-seg m6dnt-sa m6dnt-d m6dnt-t0" cx="100" cy="100" r="78" pathLength="100" transform="rotate(-90.0 100 100)"/>
        <circle class="m6dnt-seg m6dnt-sb m6dnt-d m6dnt-t4" cx="100" cy="100" r="78" pathLength="100" transform="rotate(75.6 100 100)"/>
        <circle class="m6dnt-seg m6dnt-sc m6dnt-d m6dnt-t8" cx="100" cy="100" r="78" pathLength="100" transform="rotate(172.8 100 100)"/>
        <circle class="m6dnt-seg m6dnt-sd m6dnt-d m6dnt-t12" cx="100" cy="100" r="78" pathLength="100" transform="rotate(241.2 100 100)"/>
      </svg>
      <p class="m6dnt-mid m6dnt-f m6dnt-t6" aria-hidden="true"><b>46%</b><span>at the counter</span></p>
    </div>
    <ul class="m6dnt-sr">
      <li>Counter: 46%</li>
      <li>Order ahead: 27%</li>
      <li>Delivery: 19%</li>
      <li>Catering: 8%</li>
    </ul>
  </figure>
  <div class="m6dnt-side">
    <p class="m6dnt-eyebrow">Harbour Street Café · May</p>
    <h2 class="m6dnt-h">How orders reached us</h2>
    <p class="m6dnt-lede">Nearly half of all orders were still placed at the counter; order ahead was the next biggest channel.</p>
    <ul class="m6dnt-legend" aria-hidden="true">
      <li class="m6dnt-f m6dnt-t3"><i class="m6dnt-sw m6dnt-wa"></i><span class="m6dnt-ln">Counter</span><span class="m6dnt-pc">46%</span></li>
      <li class="m6dnt-f m6dnt-t7"><i class="m6dnt-sw m6dnt-wb"></i><span class="m6dnt-ln">Order ahead</span><span class="m6dnt-pc">27%</span></li>
      <li class="m6dnt-f m6dnt-t11"><i class="m6dnt-sw m6dnt-wc"></i><span class="m6dnt-ln">Delivery</span><span class="m6dnt-pc">19%</span></li>
      <li class="m6dnt-f m6dnt-t15"><i class="m6dnt-sw m6dnt-wd"></i><span class="m6dnt-ln">Catering</span><span class="m6dnt-pc">8%</span></li>
    </ul>
    <p class="m6dnt-cap">Sample figures for an invented café. Share of all orders in the month.</p>
  </div>
</div>
<button type="button" class="m6dnt-replay" aria-label="Replay the chart"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the four segment colours at the top of .m6dnt, and each segment's --m6dnt-len and rotate() (a share minus the 0.9 gap, rotated by the shares before it times 3.6). */
.m6dnt { --m6dnt-bg: #0f1b30; --m6dnt-card: #16243d; --m6dnt-ink: #f3efe6; --m6dnt-quiet: #b9c1cf; --m6dnt-line: #2d3d5a; --m6dnt-focus: #f3efe6; --m6dnt-a: #f0c48c; --m6dnt-b: #e07c5c; --m6dnt-c: #8db4cc; --m6dnt-d: #d7d2c6; }
.m6dnt { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6dnt *, .m6dnt *::before, .m6dnt *::after { box-sizing: border-box; }
.m6dnt svg { display: block; overflow: visible; }
.m6dnt-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6dnt-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6dnt-line); border-radius: 999px; background: transparent; color: var(--m6dnt-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6dnt-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6dnt-replay:hover { color: var(--m6dnt-ink); }
.m6dnt-replay:focus-visible { outline: 2px solid var(--m6dnt-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6dnt.is-js:not([data-run]) .m6dnt-gy { transform: scaleY(0); }
  .m6dnt.is-js:not([data-run]) .m6dnt-gx { transform: scaleX(0); }
  .m6dnt.is-js:not([data-run]) .m6dnt-f { opacity: 0; }
  .m6dnt.is-js:not([data-run]) .m6dnt-o { opacity: 0; }
  .m6dnt.is-js:not([data-run]) .m6dnt-d { stroke-dashoffset: var(--m6dnt-len, 1); }
  .m6dnt.is-js:not([data-run]) .m6dnt-pop { opacity: 0; }
}
.m6dnt[data-run] .m6dnt-gy { animation: m6dnt-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6dnt[data-run] .m6dnt-gx { animation: m6dnt-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6dnt[data-run] .m6dnt-f { animation: m6dnt-f .45s ease-out both; }
.m6dnt[data-run] .m6dnt-o { animation: m6dnt-o .6s ease-out both; }
.m6dnt[data-run] .m6dnt-d { animation: m6dnt-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6dnt[data-run] .m6dnt-pop { animation: m6dnt-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6dnt-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6dnt-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6dnt-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6dnt-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6dnt-d { from { stroke-dashoffset: var(--m6dnt-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6dnt-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6dnt[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6dnt *, .m6dnt *::before, .m6dnt *::after { animation: none !important; transition: none !important; }
  .m6dnt-replay { display: none; }
}

.m6dnt { background: var(--m6dnt-bg); color: var(--m6dnt-ink); padding: 48px clamp(16px, 4vw, 48px) 80px; }
.m6dnt-card { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 44px; align-items: center; padding: 36px clamp(18px, 4vw, 44px); background: var(--m6dnt-card); border: 1px solid var(--m6dnt-line); border-radius: 16px; box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .7); }
.m6dnt-fig { margin: 0; }
.m6dnt-chart { position: relative; width: min(100%, 320px); margin: 0 auto; aspect-ratio: 1; }
.m6dnt-svg { width: 100%; height: 100%; }
.m6dnt-track { fill: none; stroke: var(--m6dnt-line); stroke-width: 26; }
.m6dnt-seg { fill: none; stroke-width: 26; stroke-dashoffset: 0; }
.m6dnt[data-run] .m6dnt-seg { animation-duration: .5s; animation-timing-function: cubic-bezier(.4, 0, .3, 1); }
.m6dnt-sa { stroke: var(--m6dnt-a); } .m6dnt-sb { stroke: var(--m6dnt-b); } .m6dnt-sc { stroke: var(--m6dnt-c); } .m6dnt-sd { stroke: var(--m6dnt-d); }
.m6dnt-mid { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.m6dnt-mid b { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(38px, 6vw, 50px); line-height: 1; }
.m6dnt-mid span { margin-top: 6px; font-size: 13.5px; color: var(--m6dnt-quiet); }
.m6dnt-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6dnt-quiet); }
.m6dnt-h { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(27px, 3.4vw, 36px); line-height: 1.1; }
.m6dnt-lede { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--m6dnt-quiet); }
.m6dnt-legend { list-style: none; margin: 22px 0 0; padding: 0; }
.m6dnt-legend li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--m6dnt-line); font-size: 15px; }
.m6dnt-sw { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.m6dnt-wa { background: var(--m6dnt-a); } .m6dnt-wb { background: var(--m6dnt-b); } .m6dnt-wc { background: var(--m6dnt-c); } .m6dnt-wd { background: var(--m6dnt-d); }
.m6dnt-ln { flex: 1; }
.m6dnt-pc { font-weight: 650; }
.m6dnt-cap { margin: 14px 0 0; font-size: 12.5px; color: var(--m6dnt-quiet); }
.m6dnt .m6dnt-replay { border-color: #3a4c6c; }
@media (max-width: 680px) {
  .m6dnt-card { grid-template-columns: 1fr; gap: 28px; }
  .m6dnt-chart { width: min(100%, 260px); }
}
.m6dnt-sa { --m6dnt-len: 45.1; stroke-dasharray: 45.1 100; }
.m6dnt-sb { --m6dnt-len: 26.1; stroke-dasharray: 26.1 100; }
.m6dnt-sc { --m6dnt-len: 18.1; stroke-dasharray: 18.1 100; }
.m6dnt-sd { --m6dnt-len: 7.1; stroke-dasharray: 7.1 100; }
.m6dnt[data-run] .m6dnt-t0 { animation-delay: 0.00s; }
.m6dnt[data-run] .m6dnt-t1 { animation-delay: 0.08s; }
.m6dnt[data-run] .m6dnt-t2 { animation-delay: 0.16s; }
.m6dnt[data-run] .m6dnt-t3 { animation-delay: 0.24s; }
.m6dnt[data-run] .m6dnt-t4 { animation-delay: 0.32s; }
.m6dnt[data-run] .m6dnt-t5 { animation-delay: 0.40s; }
.m6dnt[data-run] .m6dnt-t6 { animation-delay: 0.48s; }
.m6dnt[data-run] .m6dnt-t7 { animation-delay: 0.56s; }
.m6dnt[data-run] .m6dnt-t8 { animation-delay: 0.64s; }
.m6dnt[data-run] .m6dnt-t9 { animation-delay: 0.72s; }
.m6dnt[data-run] .m6dnt-t10 { animation-delay: 0.80s; }
.m6dnt[data-run] .m6dnt-t11 { animation-delay: 0.88s; }
.m6dnt[data-run] .m6dnt-t12 { animation-delay: 0.96s; }
.m6dnt[data-run] .m6dnt-t13 { animation-delay: 1.04s; }
.m6dnt[data-run] .m6dnt-t14 { animation-delay: 1.12s; }
.m6dnt[data-run] .m6dnt-t15 { animation-delay: 1.20s; }
.m6dnt[data-run] .m6dnt-t16 { animation-delay: 1.28s; }
.m6dnt[data-run] .m6dnt-t17 { animation-delay: 1.36s; }
.m6dnt[data-run] .m6dnt-t18 { animation-delay: 1.44s; }
.m6dnt[data-run] .m6dnt-t19 { animation-delay: 1.52s; }
.m6dnt[data-run] .m6dnt-t20 { animation-delay: 1.60s; }
.m6dnt[data-run] .m6dnt-t21 { animation-delay: 1.68s; }
.m6dnt[data-run] .m6dnt-t22 { animation-delay: 1.76s; }
.m6dnt[data-run] .m6dnt-t23 { animation-delay: 1.84s; }
.m6dnt[data-run] .m6dnt-t24 { animation-delay: 1.92s; }
.m6dnt[data-run] .m6dnt-t25 { animation-delay: 2.00s; }
.m6dnt[data-run] .m6dnt-t26 { animation-delay: 2.08s; }
.m6dnt[data-run] .m6dnt-t27 { animation-delay: 2.16s; }
.m6dnt[data-run] .m6dnt-t28 { animation-delay: 2.24s; }
.m6dnt[data-run] .m6dnt-t29 { animation-delay: 2.32s; }
.m6dnt[data-run] .m6dnt-t30 { animation-delay: 2.40s; }
.m6dnt[data-run] .m6dnt-t31 { animation-delay: 2.48s; }
.m6dnt[data-run] .m6dnt-t32 { animation-delay: 2.56s; }
.m6dnt[data-run] .m6dnt-t33 { animation-delay: 2.64s; }
.m6dnt[data-run] .m6dnt-t34 { animation-delay: 2.72s; }
.m6dnt[data-run] .m6dnt-t35 { animation-delay: 2.80s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6dnt").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6dnt-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: The ring is complete with all four segments, the centre figure and the legend in view.

Running cost: Four circle strokes repaint briefly as they fill in sequence over about 1.3 seconds, then the chart holds still.

  • Recolour the segments with `--m6dnt-a` to `--m6dnt-d`.
  • For new shares, set each segment's `--m6dnt-len` to its share minus 0.9 and its `rotate()` to -90 plus the shares before it times 3.6.
  • Remove the thin gaps between segments by setting the gap to 0 in both values.

Community Garden Season Infographic

A season summary band for a community garden's newsletter page. Each of the three line icons draws itself in gold, a seedling, a harvest basket and a ticked calendar, and its figure and short label rise in beside it, left to right. The numbers are plain text in a list, so they can be read, copied and translated like the rest of the page.

<section class="m6inf">
<div class="m6inf-wrap">
  <div class="m6inf-head">
    <p class="m6inf-eyebrow">Alder Street Growers</p>
    <h2 class="m6inf-h">The 2026 season in three numbers</h2>
  </div>
  <ul class="m6inf-stats">
    <li class="m6inf-stat">
      <svg class="m6inf-ic" viewBox="0 0 48 48" aria-hidden="true" focusable="false">
        <path class="m6inf-d m6inf-t0" d="M6 40H42" pathLength="1"/>
        <path class="m6inf-d m6inf-t1" d="M24 40V20" pathLength="1"/>
        <path class="m6inf-d m6inf-t2" d="M24 26C24 18 18 13 10 13C10 21 16 26 24 26Z" pathLength="1"/>
        <path class="m6inf-d m6inf-t3" d="M24 21C24 12 30 7 38 7C38 15 32 21 24 21Z" pathLength="1"/>
      </svg>
      <p class="m6inf-num m6inf-f m6inf-t4">42</p>
      <p class="m6inf-lab m6inf-f m6inf-t5">plots tended by members across the two allotment fields</p>
    </li>
    <li class="m6inf-stat">
      <svg class="m6inf-ic" viewBox="0 0 48 48" aria-hidden="true" focusable="false">
        <path class="m6inf-d m6inf-t3" d="M6 20H42L38 40H10Z" pathLength="1"/>
        <path class="m6inf-d m6inf-t4" d="M14 20C14 12 18.5 7 24 7C29.5 7 34 12 34 20" pathLength="1"/>
        <path class="m6inf-d m6inf-t5" d="M18 26V34M24 26V34M30 26V34" pathLength="1"/>
      </svg>
      <p class="m6inf-num m6inf-f m6inf-t7">1,180 <small>kg</small></p>
      <p class="m6inf-lab m6inf-f m6inf-t8">of fruit and vegetables weighed in at the shared table</p>
    </li>
    <li class="m6inf-stat">
      <svg class="m6inf-ic" viewBox="0 0 48 48" aria-hidden="true" focusable="false">
        <path class="m6inf-d m6inf-t6" d="M8 12H40V40H8Z" pathLength="1"/>
        <path class="m6inf-d m6inf-t7" d="M8 20H40M16 7V15M32 7V15" pathLength="1"/>
        <path class="m6inf-d m6inf-t8" d="M17 30L22 35L32 25" pathLength="1"/>
      </svg>
      <p class="m6inf-num m6inf-f m6inf-t10">36</p>
      <p class="m6inf-lab m6inf-f m6inf-t11">volunteer days for paths, compost bays and the new pond</p>
    </li>
  </ul>
  <p class="m6inf-cap">Sample figures for an invented community garden, March to October.</p>
</div>
<button type="button" class="m6inf-replay" aria-label="Replay the infographic"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the green and cream colours at the top of .m6inf, the three figures and their labels, and the icon paths. */
.m6inf { --m6inf-bg: #1e3a2d; --m6inf-card: #244434; --m6inf-ink: #f4efe2; --m6inf-quiet: #c4d0c4; --m6inf-line: #3e5d4c; --m6inf-focus: #f4efe2; --m6inf-icon: #e9c983; }
.m6inf { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6inf *, .m6inf *::before, .m6inf *::after { box-sizing: border-box; }
.m6inf svg { display: block; overflow: visible; }
.m6inf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6inf-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6inf-line); border-radius: 999px; background: transparent; color: var(--m6inf-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6inf-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6inf-replay:hover { color: var(--m6inf-ink); }
.m6inf-replay:focus-visible { outline: 2px solid var(--m6inf-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6inf.is-js:not([data-run]) .m6inf-gy { transform: scaleY(0); }
  .m6inf.is-js:not([data-run]) .m6inf-gx { transform: scaleX(0); }
  .m6inf.is-js:not([data-run]) .m6inf-f { opacity: 0; }
  .m6inf.is-js:not([data-run]) .m6inf-o { opacity: 0; }
  .m6inf.is-js:not([data-run]) .m6inf-d { stroke-dashoffset: var(--m6inf-len, 1); }
  .m6inf.is-js:not([data-run]) .m6inf-pop { opacity: 0; }
}
.m6inf[data-run] .m6inf-gy { animation: m6inf-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6inf[data-run] .m6inf-gx { animation: m6inf-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6inf[data-run] .m6inf-f { animation: m6inf-f .45s ease-out both; }
.m6inf[data-run] .m6inf-o { animation: m6inf-o .6s ease-out both; }
.m6inf[data-run] .m6inf-d { animation: m6inf-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6inf[data-run] .m6inf-pop { animation: m6inf-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6inf-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6inf-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6inf-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6inf-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6inf-d { from { stroke-dashoffset: var(--m6inf-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6inf-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6inf[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6inf *, .m6inf *::before, .m6inf *::after { animation: none !important; transition: none !important; }
  .m6inf-replay { display: none; }
}

.m6inf { background: var(--m6inf-bg); color: var(--m6inf-ink); padding: 56px clamp(18px, 5vw, 64px) 84px; }
.m6inf-wrap { max-width: 1000px; margin: 0 auto; }
.m6inf-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--m6inf-icon); }
.m6inf-h { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.01em; }
.m6inf-stats { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--m6inf-line); }
.m6inf-stat { padding: 28px 28px 8px 0; }
.m6inf-stat + .m6inf-stat { padding-left: 28px; border-left: 1px solid var(--m6inf-line); }
.m6inf-ic { width: 48px; height: 48px; }
.m6inf-ic path { fill: none; stroke: var(--m6inf-icon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.m6inf-num { margin: 18px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 6vw, 64px); line-height: 1; letter-spacing: -.02em; }
.m6inf-num small { font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif; font-size: .36em; letter-spacing: 0; color: var(--m6inf-quiet); }
.m6inf-lab { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--m6inf-quiet); max-width: 18em; }
.m6inf-cap { margin: 30px 0 0; padding-top: 14px; border-top: 1px solid var(--m6inf-line); font-size: 12.5px; color: var(--m6inf-quiet); padding-right: 110px; }
.m6inf .m6inf-replay { color: var(--m6inf-quiet); }
@media (max-width: 700px) {
  .m6inf-stats { grid-template-columns: 1fr; }
  .m6inf-stat, .m6inf-stat + .m6inf-stat { padding: 22px 0; border-left: 0; display: grid; grid-template-columns: 48px 1fr; column-gap: 18px; align-items: start; }
  .m6inf-stat + .m6inf-stat { border-top: 1px solid var(--m6inf-line); }
  .m6inf-num { margin: 0; grid-column: 2; grid-row: 1; }
  .m6inf-lab { grid-column: 2; }
}

.m6inf[data-run] .m6inf-t0 { animation-delay: 0.00s; }
.m6inf[data-run] .m6inf-t1 { animation-delay: 0.08s; }
.m6inf[data-run] .m6inf-t2 { animation-delay: 0.16s; }
.m6inf[data-run] .m6inf-t3 { animation-delay: 0.24s; }
.m6inf[data-run] .m6inf-t4 { animation-delay: 0.32s; }
.m6inf[data-run] .m6inf-t5 { animation-delay: 0.40s; }
.m6inf[data-run] .m6inf-t6 { animation-delay: 0.48s; }
.m6inf[data-run] .m6inf-t7 { animation-delay: 0.56s; }
.m6inf[data-run] .m6inf-t8 { animation-delay: 0.64s; }
.m6inf[data-run] .m6inf-t9 { animation-delay: 0.72s; }
.m6inf[data-run] .m6inf-t10 { animation-delay: 0.80s; }
.m6inf[data-run] .m6inf-t11 { animation-delay: 0.88s; }
.m6inf[data-run] .m6inf-t12 { animation-delay: 0.96s; }
.m6inf[data-run] .m6inf-t13 { animation-delay: 1.04s; }
.m6inf[data-run] .m6inf-t14 { animation-delay: 1.12s; }
.m6inf[data-run] .m6inf-t15 { animation-delay: 1.20s; }
.m6inf[data-run] .m6inf-t16 { animation-delay: 1.28s; }
.m6inf[data-run] .m6inf-t17 { animation-delay: 1.36s; }
.m6inf[data-run] .m6inf-t18 { animation-delay: 1.44s; }
.m6inf[data-run] .m6inf-t19 { animation-delay: 1.52s; }
.m6inf[data-run] .m6inf-t20 { animation-delay: 1.60s; }
.m6inf[data-run] .m6inf-t21 { animation-delay: 1.68s; }
.m6inf[data-run] .m6inf-t22 { animation-delay: 1.76s; }
.m6inf[data-run] .m6inf-t23 { animation-delay: 1.84s; }
.m6inf[data-run] .m6inf-t24 { animation-delay: 1.92s; }
.m6inf[data-run] .m6inf-t25 { animation-delay: 2.00s; }
.m6inf[data-run] .m6inf-t26 { animation-delay: 2.08s; }
.m6inf[data-run] .m6inf-t27 { animation-delay: 2.16s; }
.m6inf[data-run] .m6inf-t28 { animation-delay: 2.24s; }
.m6inf[data-run] .m6inf-t29 { animation-delay: 2.32s; }
.m6inf[data-run] .m6inf-t30 { animation-delay: 2.40s; }
.m6inf[data-run] .m6inf-t31 { animation-delay: 2.48s; }
.m6inf[data-run] .m6inf-t32 { animation-delay: 2.56s; }
.m6inf[data-run] .m6inf-t33 { animation-delay: 2.64s; }
.m6inf[data-run] .m6inf-t34 { animation-delay: 2.72s; }
.m6inf[data-run] .m6inf-t35 { animation-delay: 2.80s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6inf").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6inf-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: The icons are fully drawn and all three figures with their labels are visible straight away.

Running cost: Ten short icon strokes repaint as they draw and six text blocks fade, finished in about 1.4 seconds.

  • Swap the gold line colour with `--m6inf-icon` and the background with `--m6inf-bg`.
  • Replace a figure and its label in the markup; the layout fits values up to about six characters.
  • Redraw an icon with your own 48 by 48 paths, keeping `pathLength="1"` on each so it draws in the same way.

Revenue Share Stacked Area Chart

A four-year review card for a bike shop, showing how revenue split between repairs, parts and rentals. The bands fade in from the bottom up, then each year's share appears inside its band, so the widening rentals layer is the last thing to land. The plot stretches to any width, keeping the percentages in proportion on a phone as well as a wide report.

<section class="m6stk">
<div class="m6stk-card">
  <div class="m6stk-head">
    <div>
      <p class="m6stk-eyebrow">Spoke &amp; Chain Cycles · Four-year review</p>
      <h2 class="m6stk-h">Where each year's revenue came from</h2>
      <p class="m6stk-lede">Rentals doubled their share, from 15% to 30%, while repairs slipped from just over half to 40%.</p>
    </div>
    <ul class="m6stk-legend" aria-hidden="true">
      <li><i class="m6stk-sw m6stk-sren"></i>Rentals</li>
      <li><i class="m6stk-sw m6stk-spar"></i>Parts</li>
      <li><i class="m6stk-sw m6stk-srep"></i>Repairs</li>
    </ul>
  </div>
  <figure class="m6stk-fig">
    <div class="m6stk-plot" role="img" aria-label="Stacked area chart of revenue share from 2023 to 2026. Rentals grow from 15% to 30%, repairs fall from 52% to 40% and parts stay near a third.">
      <svg class="m6stk-svg" viewBox="0 0 640 240" preserveAspectRatio="none" aria-hidden="true" focusable="false">
        <path class="m6stk-rep m6stk-o m6stk-t0" d="M0 115.4 L80 115.4 L240 127.0 L400 136.2 L560 143.2 L640 143.2 L640 236.0 L560 236.0 L400 236.0 L240 236.0 L80 236.0 L0 236.0Z"/>
        <path class="m6stk-par m6stk-o m6stk-t3" d="M0 38.8 L80 38.8 L240 52.7 L400 64.3 L560 73.6 L640 73.6 L640 143.2 L560 143.2 L400 136.2 L240 127.0 L80 115.4 L0 115.4Z"/>
        <path class="m6stk-ren m6stk-o m6stk-t6" d="M0 4.0 L80 4.0 L240 4.0 L400 4.0 L560 4.0 L640 4.0 L640 73.6 L560 73.6 L400 64.3 L240 52.7 L80 38.8 L0 38.8Z"/>
        <g class="m6stk-ticks">
        <path d="M80 4V236"/>
        <path d="M240 4V236"/>
        <path d="M400 4V236"/>
        <path d="M560 4V236"/>
        </g>
      </svg>
      <div aria-hidden="true">
      <span class="m6stk-lab m6stk-lrep m6stk-f m6stk-t4 m6stk-p00">52%</span>
      <span class="m6stk-lab m6stk-lrep m6stk-f m6stk-t5 m6stk-p01">47%</span>
      <span class="m6stk-lab m6stk-lrep m6stk-f m6stk-t6 m6stk-p02">43%</span>
      <span class="m6stk-lab m6stk-lrep m6stk-f m6stk-t7 m6stk-p03">40%</span>
      <span class="m6stk-lab m6stk-lpar m6stk-f m6stk-t7 m6stk-p10">33%</span>
      <span class="m6stk-lab m6stk-lpar m6stk-f m6stk-t8 m6stk-p11">32%</span>
      <span class="m6stk-lab m6stk-lpar m6stk-f m6stk-t9 m6stk-p12">31%</span>
      <span class="m6stk-lab m6stk-lpar m6stk-f m6stk-t10 m6stk-p13">30%</span>
      <span class="m6stk-lab m6stk-lren m6stk-f m6stk-t10 m6stk-p20">15%</span>
      <span class="m6stk-lab m6stk-lren m6stk-f m6stk-t11 m6stk-p21">21%</span>
      <span class="m6stk-lab m6stk-lren m6stk-f m6stk-t12 m6stk-p22">26%</span>
      <span class="m6stk-lab m6stk-lren m6stk-f m6stk-t13 m6stk-p23">30%</span>
      </div>
    </div>
    <div class="m6stk-years" aria-hidden="true">
      <span class="m6stk-y0">2023</span>
      <span class="m6stk-y1">2024</span>
      <span class="m6stk-y2">2025</span>
      <span class="m6stk-y3">2026</span>
    </div>
    <ul class="m6stk-sr">
      <li>Repairs: 2023 52%, 2024 47%, 2025 43%, 2026 40%</li>
      <li>Parts: 2023 33%, 2024 32%, 2025 31%, 2026 30%</li>
      <li>Rentals: 2023 15%, 2024 21%, 2025 26%, 2026 30%</li>
    </ul>
    <figcaption class="m6stk-cap">Sample figures for an invented bike shop. Each year's columns add up to 100%.</figcaption>
  </figure>
</div>
<button type="button" class="m6stk-replay" aria-label="Replay the chart"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the three layer colours at the top of .m6stk and the share values in the band paths and labels (each column adds up to 100). */
.m6stk { --m6stk-bg: #2b2e33; --m6stk-card: #f4f3f0; --m6stk-ink: #1d1f22; --m6stk-quiet: #4f535a; --m6stk-line: #d9d7d1; --m6stk-focus: #1d1f22; --m6stk-rep: #3a3f46; --m6stk-par: #a9aeb5; --m6stk-ren: #d49c41; }
.m6stk { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6stk *, .m6stk *::before, .m6stk *::after { box-sizing: border-box; }
.m6stk svg { display: block; overflow: visible; }
.m6stk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6stk-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6stk-line); border-radius: 999px; background: transparent; color: var(--m6stk-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6stk-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6stk-replay:hover { color: var(--m6stk-ink); }
.m6stk-replay:focus-visible { outline: 2px solid var(--m6stk-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6stk.is-js:not([data-run]) .m6stk-gy { transform: scaleY(0); }
  .m6stk.is-js:not([data-run]) .m6stk-gx { transform: scaleX(0); }
  .m6stk.is-js:not([data-run]) .m6stk-f { opacity: 0; }
  .m6stk.is-js:not([data-run]) .m6stk-o { opacity: 0; }
  .m6stk.is-js:not([data-run]) .m6stk-d { stroke-dashoffset: var(--m6stk-len, 1); }
  .m6stk.is-js:not([data-run]) .m6stk-pop { opacity: 0; }
}
.m6stk[data-run] .m6stk-gy { animation: m6stk-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6stk[data-run] .m6stk-gx { animation: m6stk-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6stk[data-run] .m6stk-f { animation: m6stk-f .45s ease-out both; }
.m6stk[data-run] .m6stk-o { animation: m6stk-o .6s ease-out both; }
.m6stk[data-run] .m6stk-d { animation: m6stk-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6stk[data-run] .m6stk-pop { animation: m6stk-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6stk-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6stk-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6stk-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6stk-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6stk-d { from { stroke-dashoffset: var(--m6stk-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6stk-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6stk[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6stk *, .m6stk *::before, .m6stk *::after { animation: none !important; transition: none !important; }
  .m6stk-replay { display: none; }
}

.m6stk { background: var(--m6stk-bg); color: var(--m6stk-ink); padding: 48px clamp(16px, 4vw, 48px) 80px; }
.m6stk .m6stk-replay { color: #d7d9dc; border-color: #575c63; }
.m6stk .m6stk-replay:hover { color: #fff; }
.m6stk .m6stk-replay:focus-visible { outline-color: #fff; }
.m6stk-card { max-width: 880px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 26px; background: var(--m6stk-card); border-radius: 12px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.m6stk-head { display: flex; justify-content: space-between; gap: 20px 40px; align-items: flex-end; flex-wrap: wrap; }
.m6stk-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6stk-quiet); }
.m6stk-h { margin: 0; font-size: clamp(23px, 3vw, 30px); font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.m6stk-lede { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--m6stk-quiet); max-width: 32em; }
.m6stk-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; font-weight: 500; }
.m6stk-legend li { display: flex; align-items: center; gap: 8px; }
.m6stk-sw { width: 14px; height: 14px; border-radius: 3px; }
.m6stk-srep { background: var(--m6stk-rep); } .m6stk-spar { background: var(--m6stk-par); } .m6stk-sren { background: var(--m6stk-ren); }
.m6stk-fig { margin: 26px 0 0; }
.m6stk-plot { position: relative; height: 300px; border-radius: 6px; overflow: hidden; }
.m6stk-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m6stk-rep { fill: var(--m6stk-rep); } .m6stk-par { fill: var(--m6stk-par); } .m6stk-ren { fill: var(--m6stk-ren); }
.m6stk-ticks path { stroke: var(--m6stk-card); stroke-width: 1.2; opacity: .55; vector-effect: non-scaling-stroke; }
.m6stk-lab { position: absolute; transform: translate(-50%, -50%); font-size: 14px; font-weight: 650; color: var(--m6stk-ink); }
.m6stk[data-run] .m6stk-lab { animation-name: m6stk-lab; }
@keyframes m6stk-lab { from { opacity: 0; transform: translate(-50%, -30%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.m6stk-lrep { color: #fff; }
.m6stk-years { position: relative; height: 22px; margin-top: 8px; font-size: 13px; color: var(--m6stk-quiet); }
.m6stk-years span { position: absolute; transform: translateX(-50%); }
.m6stk-cap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--m6stk-line); font-size: 12.5px; color: var(--m6stk-quiet); }
@media (max-width: 560px) {
  .m6stk-plot { height: 260px; }
  .m6stk-lab { font-size: 12.5px; }
}
.m6stk-p00 { left: 12.500%; top: 73.200%; }
.m6stk-p01 { left: 37.500%; top: 75.617%; }
.m6stk-p02 { left: 62.500%; top: 77.550%; }
.m6stk-p03 { left: 87.500%; top: 79.000%; }
.m6stk-p10 { left: 12.500%; top: 32.117%; }
.m6stk-p11 { left: 37.500%; top: 37.433%; }
.m6stk-p12 { left: 62.500%; top: 41.783%; }
.m6stk-p13 { left: 87.500%; top: 45.167%; }
.m6stk-p20 { left: 12.500%; top: 8.917%; }
.m6stk-p21 { left: 37.500%; top: 11.817%; }
.m6stk-p22 { left: 62.500%; top: 14.233%; }
.m6stk-p23 { left: 87.500%; top: 16.167%; }
.m6stk-y0 { left: 12.500%; }
.m6stk-y1 { left: 37.500%; }
.m6stk-y2 { left: 62.500%; }
.m6stk-y3 { left: 87.500%; }
.m6stk[data-run] .m6stk-t0 { animation-delay: 0.00s; }
.m6stk[data-run] .m6stk-t1 { animation-delay: 0.08s; }
.m6stk[data-run] .m6stk-t2 { animation-delay: 0.16s; }
.m6stk[data-run] .m6stk-t3 { animation-delay: 0.24s; }
.m6stk[data-run] .m6stk-t4 { animation-delay: 0.32s; }
.m6stk[data-run] .m6stk-t5 { animation-delay: 0.40s; }
.m6stk[data-run] .m6stk-t6 { animation-delay: 0.48s; }
.m6stk[data-run] .m6stk-t7 { animation-delay: 0.56s; }
.m6stk[data-run] .m6stk-t8 { animation-delay: 0.64s; }
.m6stk[data-run] .m6stk-t9 { animation-delay: 0.72s; }
.m6stk[data-run] .m6stk-t10 { animation-delay: 0.80s; }
.m6stk[data-run] .m6stk-t11 { animation-delay: 0.88s; }
.m6stk[data-run] .m6stk-t12 { animation-delay: 0.96s; }
.m6stk[data-run] .m6stk-t13 { animation-delay: 1.04s; }
.m6stk[data-run] .m6stk-t14 { animation-delay: 1.12s; }
.m6stk[data-run] .m6stk-t15 { animation-delay: 1.20s; }
.m6stk[data-run] .m6stk-t16 { animation-delay: 1.28s; }
.m6stk[data-run] .m6stk-t17 { animation-delay: 1.36s; }
.m6stk[data-run] .m6stk-t18 { animation-delay: 1.44s; }
.m6stk[data-run] .m6stk-t19 { animation-delay: 1.52s; }
.m6stk[data-run] .m6stk-t20 { animation-delay: 1.60s; }
.m6stk[data-run] .m6stk-t21 { animation-delay: 1.68s; }
.m6stk[data-run] .m6stk-t22 { animation-delay: 1.76s; }
.m6stk[data-run] .m6stk-t23 { animation-delay: 1.84s; }
.m6stk[data-run] .m6stk-t24 { animation-delay: 1.92s; }
.m6stk[data-run] .m6stk-t25 { animation-delay: 2.00s; }
.m6stk[data-run] .m6stk-t26 { animation-delay: 2.08s; }
.m6stk[data-run] .m6stk-t27 { animation-delay: 2.16s; }
.m6stk[data-run] .m6stk-t28 { animation-delay: 2.24s; }
.m6stk[data-run] .m6stk-t29 { animation-delay: 2.32s; }
.m6stk[data-run] .m6stk-t30 { animation-delay: 2.40s; }
.m6stk[data-run] .m6stk-t31 { animation-delay: 2.48s; }
.m6stk[data-run] .m6stk-t32 { animation-delay: 2.56s; }
.m6stk[data-run] .m6stk-t33 { animation-delay: 2.64s; }
.m6stk[data-run] .m6stk-t34 { animation-delay: 2.72s; }
.m6stk[data-run] .m6stk-t35 { animation-delay: 2.80s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6stk").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6stk-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: All three bands and their twelve percentages are shown at once with nothing moving.

Running cost: Three filled shapes fade in by opacity and twelve labels follow, all within about 1.5 seconds; after that nothing repaints.

  • Recolour the bands with `--m6stk-rep`, `--m6stk-par` and `--m6stk-ren`.
  • Change a share by editing the y points of the band paths (2.32 units per percent) and the matching percentage label.
  • Make the plot taller or shorter with the 300px height on `.m6stk-plot`; the bands stretch to fit.

Restoration Timeline With Stages Lighting Up

A process timeline for a furniture restorer's services page. A brass line runs along the rail at an even pace and each stage's node lights as the line reaches it, with its day range appearing underneath, until all five are lit. On phones the rail turns vertical and fills downward beside the stages.

<section class="m6tml">
<div class="m6tml-wrap">
  <div class="m6tml-head">
    <p class="m6tml-eyebrow">Hollis Restoration · Chairs</p>
    <h2 class="m6tml-h">Two weeks from collection to return</h2>
    <p class="m6tml-lede">A typical dining chair moves through five stages in the workshop. Larger pieces take longer at the repair stage.</p>
  </div>
  <div class="m6tml-tl">
    <span class="m6tml-rail" aria-hidden="true"><i class="m6tml-fill m6tml-gx"></i></span>
    <ol class="m6tml-stages" aria-label="Restoration stages in order">
    <li class="m6tml-stage">
      <span class="m6tml-node" aria-hidden="true"><i class="m6tml-ring"></i><i class="m6tml-core m6tml-pop m6tml-k0"></i></span>
      <span class="m6tml-day m6tml-f m6tml-k0">Day 1</span>
      <h3 class="m6tml-sh">Assess</h3>
      <p class="m6tml-sp">We check the frame, joints and finish and agree the work with you.</p>
    </li>
    <li class="m6tml-stage">
      <span class="m6tml-node" aria-hidden="true"><i class="m6tml-ring"></i><i class="m6tml-core m6tml-pop m6tml-k1"></i></span>
      <span class="m6tml-day m6tml-f m6tml-k1">Days 2 to 4</span>
      <h3 class="m6tml-sh">Strip</h3>
      <p class="m6tml-sp">Old varnish comes off by hand so the grain is not scoured.</p>
    </li>
    <li class="m6tml-stage">
      <span class="m6tml-node" aria-hidden="true"><i class="m6tml-ring"></i><i class="m6tml-core m6tml-pop m6tml-k2"></i></span>
      <span class="m6tml-day m6tml-f m6tml-k2">Days 5 to 9</span>
      <h3 class="m6tml-sh">Repair</h3>
      <p class="m6tml-sp">Loose joints are reglued and a cracked rail is spliced.</p>
    </li>
    <li class="m6tml-stage">
      <span class="m6tml-node" aria-hidden="true"><i class="m6tml-ring"></i><i class="m6tml-core m6tml-pop m6tml-k3"></i></span>
      <span class="m6tml-day m6tml-f m6tml-k3">Days 10 to 13</span>
      <h3 class="m6tml-sh">Finish</h3>
      <p class="m6tml-sp">Three thin coats of oil, rubbed back between each one.</p>
    </li>
    <li class="m6tml-stage">
      <span class="m6tml-node" aria-hidden="true"><i class="m6tml-ring"></i><i class="m6tml-core m6tml-pop m6tml-k4"></i></span>
      <span class="m6tml-day m6tml-f m6tml-k4">Day 14</span>
      <h3 class="m6tml-sh">Return</h3>
      <p class="m6tml-sp">We deliver the chair and show you how to care for it.</p>
    </li>
    </ol>
  </div>
  <p class="m6tml-cap">Sample timings for an invented workshop, counted in working days.</p>
</div>
<button type="button" class="m6tml-replay" aria-label="Replay the timeline"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the brass and navy colours at the top of .m6tml, the five stages, and the .m6tml-k delays (0.27s apart, matching the 1.1s track fill). */
.m6tml { --m6tml-bg: #f5f3ee; --m6tml-card: #ffffff; --m6tml-ink: #1a2333; --m6tml-quiet: #505a6a; --m6tml-line: #dcd8cf; --m6tml-focus: #1a2333; --m6tml-brass: #a57a2c; --m6tml-navy: #1f2d47; }
.m6tml { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6tml *, .m6tml *::before, .m6tml *::after { box-sizing: border-box; }
.m6tml svg { display: block; overflow: visible; }
.m6tml-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6tml-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6tml-line); border-radius: 999px; background: transparent; color: var(--m6tml-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6tml-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6tml-replay:hover { color: var(--m6tml-ink); }
.m6tml-replay:focus-visible { outline: 2px solid var(--m6tml-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6tml.is-js:not([data-run]) .m6tml-gy { transform: scaleY(0); }
  .m6tml.is-js:not([data-run]) .m6tml-gx { transform: scaleX(0); }
  .m6tml.is-js:not([data-run]) .m6tml-f { opacity: 0; }
  .m6tml.is-js:not([data-run]) .m6tml-o { opacity: 0; }
  .m6tml.is-js:not([data-run]) .m6tml-d { stroke-dashoffset: var(--m6tml-len, 1); }
  .m6tml.is-js:not([data-run]) .m6tml-pop { opacity: 0; }
}
.m6tml[data-run] .m6tml-gy { animation: m6tml-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6tml[data-run] .m6tml-gx { animation: m6tml-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6tml[data-run] .m6tml-f { animation: m6tml-f .45s ease-out both; }
.m6tml[data-run] .m6tml-o { animation: m6tml-o .6s ease-out both; }
.m6tml[data-run] .m6tml-d { animation: m6tml-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6tml[data-run] .m6tml-pop { animation: m6tml-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6tml-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6tml-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6tml-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6tml-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6tml-d { from { stroke-dashoffset: var(--m6tml-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6tml-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6tml[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6tml *, .m6tml *::before, .m6tml *::after { animation: none !important; transition: none !important; }
  .m6tml-replay { display: none; }
}

.m6tml { background: var(--m6tml-bg); color: var(--m6tml-ink); padding: 52px clamp(16px, 4vw, 56px) 84px; }
.m6tml-wrap { max-width: 1080px; margin: 0 auto; }
.m6tml-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6tml-brass); }
.m6tml-h { margin: 0; font-size: clamp(26px, 3.4vw, 36px); font-weight: 650; letter-spacing: -.02em; line-height: 1.12; }
.m6tml-lede { margin: 12px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--m6tml-quiet); max-width: 36em; }
.m6tml-tl { position: relative; margin-top: 40px; }
.m6tml-rail { position: absolute; left: 10%; right: 10%; top: 13px; height: 2px; background: var(--m6tml-line); }
.m6tml-fill { position: absolute; inset: 0; background: var(--m6tml-brass); transform-origin: 0 50%; }
.m6tml[data-run] .m6tml-fill { animation-duration: 1.1s; animation-delay: .1s; animation-timing-function: linear; }
.m6tml-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.m6tml-stage { position: relative; text-align: center; }
.m6tml-node { position: relative; display: block; width: 28px; height: 28px; margin: 0 auto; }
.m6tml-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--m6tml-bg); border: 2px solid var(--m6tml-line); }
.m6tml-core { position: absolute; inset: 0; border-radius: 50%; background: var(--m6tml-brass); box-shadow: 0 0 0 5px rgba(165, 122, 44, .18); }
.m6tml-core::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--m6tml-card); }
.m6tml-day { display: block; margin-top: 16px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--m6tml-brass); }
.m6tml-sh { margin: 6px 0 0; font-size: 18px; font-weight: 650; color: var(--m6tml-navy); }
.m6tml-sp { margin: 6px auto 0; font-size: 14px; line-height: 1.5; color: var(--m6tml-quiet); max-width: 15em; }
.m6tml-cap { margin: 34px 0 0; padding-top: 14px; border-top: 1px solid var(--m6tml-line); font-size: 12.5px; color: var(--m6tml-quiet); padding-right: 110px; }
@media (max-width: 760px) {
  .m6tml-rail { left: 13px; right: auto; top: 14px; bottom: 0; width: 2px; height: auto; }
  .m6tml-fill { transform-origin: 50% 0; }
  .m6tml.is-js:not([data-run]) .m6tml-fill { transform: scaleY(0); }
  .m6tml[data-run] .m6tml-fill { animation-name: m6tml-gy; }
  .m6tml-stages { grid-template-columns: 1fr; gap: 22px; }
  .m6tml-stage { text-align: left; padding-left: 48px; }
  .m6tml-node { position: absolute; left: 0; top: 0; }
  .m6tml-day { margin-top: 4px; }
  .m6tml-sp { margin-left: 0; }
  .m6tml-stage:last-child::before { content: ""; position: absolute; left: 12px; top: 28px; bottom: 0; width: 4px; background: var(--m6tml-bg); }
  .m6tml-node { z-index: 1; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .m6tml.is-js:not([data-run]) .m6tml-fill { transform: none; } }
.m6tml[data-run] .m6tml-k0 { animation-delay: 0.10s; }
.m6tml[data-run] .m6tml-k1 { animation-delay: 0.37s; }
.m6tml[data-run] .m6tml-k2 { animation-delay: 0.64s; }
.m6tml[data-run] .m6tml-k3 { animation-delay: 0.91s; }
.m6tml[data-run] .m6tml-k4 { animation-delay: 1.18s; }
.m6tml[data-run] .m6tml-t0 { animation-delay: 0.00s; }
.m6tml[data-run] .m6tml-t1 { animation-delay: 0.06s; }
.m6tml[data-run] .m6tml-t2 { animation-delay: 0.12s; }
.m6tml[data-run] .m6tml-t3 { animation-delay: 0.18s; }
.m6tml[data-run] .m6tml-t4 { animation-delay: 0.24s; }
.m6tml[data-run] .m6tml-t5 { animation-delay: 0.30s; }
.m6tml[data-run] .m6tml-t6 { animation-delay: 0.36s; }
.m6tml[data-run] .m6tml-t7 { animation-delay: 0.42s; }
.m6tml[data-run] .m6tml-t8 { animation-delay: 0.48s; }
.m6tml[data-run] .m6tml-t9 { animation-delay: 0.54s; }
.m6tml[data-run] .m6tml-t10 { animation-delay: 0.60s; }
.m6tml[data-run] .m6tml-t11 { animation-delay: 0.66s; }
.m6tml[data-run] .m6tml-t12 { animation-delay: 0.72s; }
.m6tml[data-run] .m6tml-t13 { animation-delay: 0.78s; }
.m6tml[data-run] .m6tml-t14 { animation-delay: 0.84s; }
.m6tml[data-run] .m6tml-t15 { animation-delay: 0.90s; }
.m6tml[data-run] .m6tml-t16 { animation-delay: 0.96s; }
.m6tml[data-run] .m6tml-t17 { animation-delay: 1.02s; }
.m6tml[data-run] .m6tml-t18 { animation-delay: 1.08s; }
.m6tml[data-run] .m6tml-t19 { animation-delay: 1.14s; }
.m6tml[data-run] .m6tml-t20 { animation-delay: 1.20s; }
.m6tml[data-run] .m6tml-t21 { animation-delay: 1.26s; }
.m6tml[data-run] .m6tml-t22 { animation-delay: 1.32s; }
.m6tml[data-run] .m6tml-t23 { animation-delay: 1.38s; }
.m6tml[data-run] .m6tml-t24 { animation-delay: 1.44s; }
.m6tml[data-run] .m6tml-t25 { animation-delay: 1.50s; }
.m6tml[data-run] .m6tml-t26 { animation-delay: 1.56s; }
.m6tml[data-run] .m6tml-t27 { animation-delay: 1.62s; }
.m6tml[data-run] .m6tml-t28 { animation-delay: 1.68s; }
.m6tml[data-run] .m6tml-t29 { animation-delay: 1.74s; }
.m6tml[data-run] .m6tml-t30 { animation-delay: 1.80s; }
.m6tml[data-run] .m6tml-t31 { animation-delay: 1.86s; }
.m6tml[data-run] .m6tml-t32 { animation-delay: 1.92s; }
.m6tml[data-run] .m6tml-t33 { animation-delay: 1.98s; }
.m6tml[data-run] .m6tml-t34 { animation-delay: 2.04s; }
.m6tml[data-run] .m6tml-t35 { animation-delay: 2.10s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6tml").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6tml-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: The rail is filled and every stage is lit with its days and description showing.

Running cost: One line scales and five nodes and labels fade on the compositor over about 1.5 seconds, then nothing moves.

  • Change the line and node colour with `--m6tml-brass` and the headings with `--m6tml-navy`.
  • Add or remove a stage in the list and in the column count, then space the `.m6tml-k` delays evenly across the 1.1s fill.
  • Edit the day ranges and descriptions in each list item.

Garden Shop Orders Line Chart That Draws

A season report card for a garden shop. The line traces the months from left to right at an even pace, and each point's dot and order count appear just as the line reaches it, so the eye follows the climb to June and the slow fall after. A pale fill settles underneath once the line is drawn. Labels are HTML laid over the SVG, so they stay readable on a phone.

<section class="m6lin">
<div class="m6lin-card">
  <div class="m6lin-head">
    <p class="m6lin-eyebrow">Moss &amp; Pine Garden Shop · Season report</p>
    <h2 class="m6lin-h">Plant orders by month</h2>
    <p class="m6lin-lede">Orders climbed through spring to a June high of 395, held up over late summer and eased off into November.</p>
  </div>
  <figure class="m6lin-fig">
    <div class="m6lin-plot" role="img" aria-label="Line chart of plant orders from April to November. Orders rise from 210 in April to a peak of 395 in June, then fall to 180 in November.">
      <svg class="m6lin-svg" viewBox="0 0 640 260" aria-hidden="true" focusable="false">
        <g class="m6lin-grid">
      <path d="M40 179.0H600"/>
      <path d="M40 130.0H600"/>
      <path d="M40 81.0H600"/>
      <path d="M40 32.0H600"/>
        </g>
        <path class="m6lin-area m6lin-o m6lin-t9" d="M40 125.1 L120 61.4 L200 34.4 L280 51.6 L360 78.6 L440 66.3 L520 95.7 L600 139.8 L600 228 L40 228Z"/>
        <path class="m6lin-path m6lin-d" d="M40 125.1 L120 61.4 L200 34.4 L280 51.6 L360 78.6 L440 66.3 L520 95.7 L600 139.8" pathLength="1"/>
        <path class="m6lin-axis" d="M28 228H612"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k0" cx="40" cy="125.1" r="4.5"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k1" cx="120" cy="61.4" r="4.5"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k2 m6lin-peak" cx="200" cy="34.4" r="6"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k3" cx="280" cy="51.6" r="4.5"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k4" cx="360" cy="78.6" r="4.5"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k5" cx="440" cy="66.3" r="4.5"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k6" cx="520" cy="95.7" r="4.5"/>
      <circle class="m6lin-dot m6lin-pop m6lin-k7" cx="600" cy="139.8" r="4.5"/>
      </svg>
      <div class="m6lin-labs" aria-hidden="true">
      <span class="m6lin-lab m6lin-f m6lin-k0 m6lin-x0">210</span>
      <span class="m6lin-lab m6lin-f m6lin-k1 m6lin-x1">340</span>
      <span class="m6lin-lab m6lin-f m6lin-k2 m6lin-peak m6lin-x2">395</span>
      <span class="m6lin-lab m6lin-f m6lin-k3 m6lin-x3">360</span>
      <span class="m6lin-lab m6lin-f m6lin-k4 m6lin-x4">305</span>
      <span class="m6lin-lab m6lin-f m6lin-k5 m6lin-x5">330</span>
      <span class="m6lin-lab m6lin-f m6lin-k6 m6lin-x6">270</span>
      <span class="m6lin-lab m6lin-f m6lin-k7 m6lin-x7">180</span>
      </div>
    </div>
    <div class="m6lin-months" aria-hidden="true">
      <span class="m6lin-x0">Apr</span>
      <span class="m6lin-x1">May</span>
      <span class="m6lin-x2">Jun</span>
      <span class="m6lin-x3">Jul</span>
      <span class="m6lin-x4">Aug</span>
      <span class="m6lin-x5">Sep</span>
      <span class="m6lin-x6">Oct</span>
      <span class="m6lin-x7">Nov</span>
    </div>
    <ul class="m6lin-sr">
      <li>April: 210 orders</li>
      <li>May: 340 orders</li>
      <li>June: 395 orders</li>
      <li>July: 360 orders</li>
      <li>August: 305 orders</li>
      <li>September: 330 orders</li>
      <li>October: 270 orders</li>
      <li>November: 180 orders</li>
    </ul>
    <figcaption class="m6lin-cap">Sample figures for an invented garden shop. Online and phone orders combined.</figcaption>
  </figure>
</div>
<button type="button" class="m6lin-replay" aria-label="Replay the chart"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the line and fill colours at the top of .m6lin, and the points in the line and area paths (each month is 80 units apart). */
.m6lin { --m6lin-bg: #e4ebe3; --m6lin-card: #f7f9f5; --m6lin-ink: #1b2a21; --m6lin-quiet: #4d5e53; --m6lin-line: #d3ddd2; --m6lin-focus: #2f5d46; --m6lin-plot: #2f5d46; --m6lin-fill: #b9d0bf; --m6lin-peakc: #b0612e; }
.m6lin { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6lin *, .m6lin *::before, .m6lin *::after { box-sizing: border-box; }
.m6lin svg { display: block; overflow: visible; }
.m6lin-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6lin-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6lin-line); border-radius: 999px; background: transparent; color: var(--m6lin-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6lin-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6lin-replay:hover { color: var(--m6lin-ink); }
.m6lin-replay:focus-visible { outline: 2px solid var(--m6lin-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6lin.is-js:not([data-run]) .m6lin-gy { transform: scaleY(0); }
  .m6lin.is-js:not([data-run]) .m6lin-gx { transform: scaleX(0); }
  .m6lin.is-js:not([data-run]) .m6lin-f { opacity: 0; }
  .m6lin.is-js:not([data-run]) .m6lin-o { opacity: 0; }
  .m6lin.is-js:not([data-run]) .m6lin-d { stroke-dashoffset: var(--m6lin-len, 1); }
  .m6lin.is-js:not([data-run]) .m6lin-pop { opacity: 0; }
}
.m6lin[data-run] .m6lin-gy { animation: m6lin-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6lin[data-run] .m6lin-gx { animation: m6lin-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6lin[data-run] .m6lin-f { animation: m6lin-f .45s ease-out both; }
.m6lin[data-run] .m6lin-o { animation: m6lin-o .6s ease-out both; }
.m6lin[data-run] .m6lin-d { animation: m6lin-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6lin[data-run] .m6lin-pop { animation: m6lin-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6lin-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6lin-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6lin-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6lin-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6lin-d { from { stroke-dashoffset: var(--m6lin-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6lin-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6lin[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6lin *, .m6lin *::before, .m6lin *::after { animation: none !important; transition: none !important; }
  .m6lin-replay { display: none; }
}

.m6lin { background: var(--m6lin-bg); color: var(--m6lin-ink); padding: 48px clamp(16px, 4vw, 48px) 80px; }
.m6lin-card { max-width: 820px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 26px; background: var(--m6lin-card); border: 1px solid var(--m6lin-line); border-radius: 14px; box-shadow: 0 28px 50px -38px rgba(27, 42, 33, .55); }
.m6lin-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6lin-quiet); }
.m6lin-h { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.m6lin-lede { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--m6lin-quiet); max-width: 36em; }
.m6lin-fig { margin: 30px 0 0; }
.m6lin-plot { position: relative; aspect-ratio: 640 / 260; }
.m6lin-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m6lin-grid path { fill: none; stroke: var(--m6lin-line); stroke-width: 1; stroke-dasharray: 3 4; }
.m6lin-axis { fill: none; stroke: var(--m6lin-ink); stroke-width: 1.5; }
.m6lin-area { fill: var(--m6lin-fill); opacity: .55; }
.m6lin[data-run] .m6lin-area { animation-name: m6lin-area; animation-duration: .9s; }
@keyframes m6lin-area { from { opacity: 0; } to { opacity: .55; } }
.m6lin-path { fill: none; stroke: var(--m6lin-plot); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.m6lin[data-run] .m6lin-path { animation-duration: 1.15s; animation-delay: .1s; animation-timing-function: linear; }
.m6lin-dot { fill: var(--m6lin-card); stroke: var(--m6lin-plot); stroke-width: 2.5; transform-box: fill-box; transform-origin: 50% 50%; }
.m6lin-dot.m6lin-peak { fill: var(--m6lin-peakc); stroke: var(--m6lin-card); stroke-width: 2.5; }
.m6lin-labs { position: absolute; inset: 0; }
.m6lin-lab { position: absolute; transform: translate(-50%, calc(-100% - 10px)); font-size: 13px; font-weight: 600; color: var(--m6lin-quiet); white-space: nowrap; }
.m6lin[data-run] .m6lin-lab { animation-name: m6lin-lab; }
@keyframes m6lin-lab { from { opacity: 0; transform: translate(-50%, calc(-100% - 4px)); } to { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); } }
.m6lin-lab.m6lin-peak { color: var(--m6lin-peakc); font-size: 15px; font-weight: 700; }
.m6lin-months { position: relative; height: 22px; margin-top: 6px; font-size: 13px; color: var(--m6lin-quiet); }
.m6lin-months span { position: absolute; top: 0; transform: translateX(-50%); }
.m6lin-cap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--m6lin-line); font-size: 12.5px; color: var(--m6lin-quiet); padding-right: 96px; }
@media (max-width: 560px) {
  .m6lin-lab { font-size: 11.5px; }
  .m6lin-lab.m6lin-peak { font-size: 12.5px; }
  .m6lin-months { font-size: 11.5px; }
  .m6lin-path { stroke-width: 3.6; }
}
.m6lin-x0 { left: 6.250%; }
.m6lin-lab.m6lin-x0 { top: 48.115%; }
.m6lin[data-run] .m6lin-k0 { animation-delay: 0.12s; }
.m6lin-x1 { left: 18.750%; }
.m6lin-lab.m6lin-x1 { top: 23.615%; }
.m6lin[data-run] .m6lin-k1 { animation-delay: 0.27s; }
.m6lin-x2 { left: 31.250%; }
.m6lin-lab.m6lin-x2 { top: 13.250%; }
.m6lin[data-run] .m6lin-k2 { animation-delay: 0.42s; }
.m6lin-x3 { left: 43.750%; }
.m6lin-lab.m6lin-x3 { top: 19.846%; }
.m6lin[data-run] .m6lin-k3 { animation-delay: 0.57s; }
.m6lin-x4 { left: 56.250%; }
.m6lin-lab.m6lin-x4 { top: 30.212%; }
.m6lin[data-run] .m6lin-k4 { animation-delay: 0.72s; }
.m6lin-x5 { left: 68.750%; }
.m6lin-lab.m6lin-x5 { top: 25.500%; }
.m6lin[data-run] .m6lin-k5 { animation-delay: 0.87s; }
.m6lin-x6 { left: 81.250%; }
.m6lin-lab.m6lin-x6 { top: 36.808%; }
.m6lin[data-run] .m6lin-k6 { animation-delay: 1.02s; }
.m6lin-x7 { left: 93.750%; }
.m6lin-lab.m6lin-x7 { top: 53.769%; }
.m6lin[data-run] .m6lin-k7 { animation-delay: 1.17s; }
.m6lin[data-run] .m6lin-t0 { animation-delay: 0.00s; }
.m6lin[data-run] .m6lin-t1 { animation-delay: 0.06s; }
.m6lin[data-run] .m6lin-t2 { animation-delay: 0.12s; }
.m6lin[data-run] .m6lin-t3 { animation-delay: 0.18s; }
.m6lin[data-run] .m6lin-t4 { animation-delay: 0.24s; }
.m6lin[data-run] .m6lin-t5 { animation-delay: 0.30s; }
.m6lin[data-run] .m6lin-t6 { animation-delay: 0.36s; }
.m6lin[data-run] .m6lin-t7 { animation-delay: 0.42s; }
.m6lin[data-run] .m6lin-t8 { animation-delay: 0.48s; }
.m6lin[data-run] .m6lin-t9 { animation-delay: 0.54s; }
.m6lin[data-run] .m6lin-t10 { animation-delay: 0.60s; }
.m6lin[data-run] .m6lin-t11 { animation-delay: 0.66s; }
.m6lin[data-run] .m6lin-t12 { animation-delay: 0.72s; }
.m6lin[data-run] .m6lin-t13 { animation-delay: 0.78s; }
.m6lin[data-run] .m6lin-t14 { animation-delay: 0.84s; }
.m6lin[data-run] .m6lin-t15 { animation-delay: 0.90s; }
.m6lin[data-run] .m6lin-t16 { animation-delay: 0.96s; }
.m6lin[data-run] .m6lin-t17 { animation-delay: 1.02s; }
.m6lin[data-run] .m6lin-t18 { animation-delay: 1.08s; }
.m6lin[data-run] .m6lin-t19 { animation-delay: 1.14s; }
.m6lin[data-run] .m6lin-t20 { animation-delay: 1.20s; }
.m6lin[data-run] .m6lin-t21 { animation-delay: 1.26s; }
.m6lin[data-run] .m6lin-t22 { animation-delay: 1.32s; }
.m6lin[data-run] .m6lin-t23 { animation-delay: 1.38s; }
.m6lin[data-run] .m6lin-t24 { animation-delay: 1.44s; }
.m6lin[data-run] .m6lin-t25 { animation-delay: 1.50s; }
.m6lin[data-run] .m6lin-t26 { animation-delay: 1.56s; }
.m6lin[data-run] .m6lin-t27 { animation-delay: 1.62s; }
.m6lin[data-run] .m6lin-t28 { animation-delay: 1.68s; }
.m6lin[data-run] .m6lin-t29 { animation-delay: 1.74s; }
.m6lin[data-run] .m6lin-t30 { animation-delay: 1.80s; }
.m6lin[data-run] .m6lin-t31 { animation-delay: 1.86s; }
.m6lin[data-run] .m6lin-t32 { animation-delay: 1.92s; }
.m6lin[data-run] .m6lin-t33 { animation-delay: 1.98s; }
.m6lin[data-run] .m6lin-t34 { animation-delay: 2.04s; }
.m6lin[data-run] .m6lin-t35 { animation-delay: 2.10s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6lin").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6lin-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: The line is fully drawn with its fill, dots and every monthly count in place.

Running cost: One path repaints while it draws for just over a second, and eight dots and labels fade on the compositor; then the card is static.

  • Recolour the line with `--m6lin-plot`, the fill with `--m6lin-fill` and the peak with `--m6lin-peakc`.
  • To plot your own months, change the y values in both the line and area paths and move each dot and `.m6lin-lab` rule to match.
  • Slow or quicken the drawing with the 1.15s duration on `.m6lin-path`, and scale the `.m6lin-k` delays by the same amount.

Order Flow Diagram With Moving Lines

A delivery explainer for a noodle restaurant's help page. Four step cards fade in from order to doorstep, and the connectors between them are dashed lines whose dashes keep sliding toward the arrow heads, so the direction of travel reads at a glance. On phones the steps stack and the connectors turn to point down.

<section class="m6flw">
<div class="m6flw-wrap">
  <div class="m6flw-head">
    <p class="m6flw-eyebrow">Hanami Noodle House · Delivery</p>
    <h2 class="m6flw-h">How your order gets to you</h2>
    <p class="m6flw-lede">Four hand-offs between the moment you order and the knock at the door. Times are typical on a weekday evening.</p>
  </div>
  <ol class="m6flw-flow" aria-label="Order journey in four steps">
    <li class="m6flw-node m6flw-f m6flw-t0">
      <svg class="m6flw-ic" viewBox="0 0 32 32" aria-hidden="true" focusable="false"><path d="M8 4H24V28L20 25.5L16 28L12 25.5L8 28Z"/><path d="M12 10H20M12 15H20M12 20H17"/></svg>
      <span class="m6flw-step">Step 1</span>
      <h3 class="m6flw-nh">Order placed</h3>
      <p class="m6flw-np">You order on the site or by phone and get a confirmation text.</p>
    </li>
    <li class="m6flw-link m6flw-o m6flw-t2" aria-label="then, about 2 min">
      <svg class="m6flw-wire" viewBox="0 0 64 24" aria-hidden="true" focusable="false"><path class="m6flw-dash" d="M4 12H50"/><path class="m6flw-tip" d="M47 6L55 12L47 18"/></svg>
      <span class="m6flw-time" aria-hidden="true">about 2 min</span>
    </li>
    <li class="m6flw-node m6flw-f m6flw-t3">
      <svg class="m6flw-ic" viewBox="0 0 32 32" aria-hidden="true" focusable="false"><path d="M5 15H27C27 21.5 22 26 16 26C10 26 5 21.5 5 15Z"/><path d="M11 11C11 9 13 9 13 7M17 11C17 9 19 9 19 7"/><path d="M12 26V28H20V26"/></svg>
      <span class="m6flw-step">Step 2</span>
      <h3 class="m6flw-nh">Kitchen</h3>
      <p class="m6flw-np">Noodles are cooked to order and packed with the broth kept apart.</p>
    </li>
    <li class="m6flw-link m6flw-o m6flw-t5" aria-label="then, about 12 min">
      <svg class="m6flw-wire" viewBox="0 0 64 24" aria-hidden="true" focusable="false"><path class="m6flw-dash" d="M4 12H50"/><path class="m6flw-tip" d="M47 6L55 12L47 18"/></svg>
      <span class="m6flw-time" aria-hidden="true">about 12 min</span>
    </li>
    <li class="m6flw-node m6flw-f m6flw-t6">
      <svg class="m6flw-ic" viewBox="0 0 32 32" aria-hidden="true" focusable="false"><circle cx="8" cy="22" r="5"/><circle cx="24" cy="22" r="5"/><path d="M8 22L13 12H20L24 22M13 12L16 22H8M18 8H22"/></svg>
      <span class="m6flw-step">Step 3</span>
      <h3 class="m6flw-nh">Courier</h3>
      <p class="m6flw-np">A rider collects the bag in an insulated box and heads your way.</p>
    </li>
    <li class="m6flw-link m6flw-o m6flw-t8" aria-label="then, about 15 min">
      <svg class="m6flw-wire" viewBox="0 0 64 24" aria-hidden="true" focusable="false"><path class="m6flw-dash" d="M4 12H50"/><path class="m6flw-tip" d="M47 6L55 12L47 18"/></svg>
      <span class="m6flw-time" aria-hidden="true">about 15 min</span>
    </li>
    <li class="m6flw-node m6flw-f m6flw-t9">
      <svg class="m6flw-ic" viewBox="0 0 32 32" aria-hidden="true" focusable="false"><path d="M8 28V5H24V28M5 28H27"/><circle cx="19.5" cy="17" r="1.2"/></svg>
      <span class="m6flw-step">Step 4</span>
      <h3 class="m6flw-nh">Your door</h3>
      <p class="m6flw-np">The rider rings once and leaves it with you, still hot.</p>
    </li>
  </ol>
  <p class="m6flw-cap">Sample figures for an invented restaurant. Times vary with distance and weather.</p>
</div>
<button type="button" class="m6flw-replay" aria-label="Replay the diagram"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the terracotta line colour at the top of .m6flw, the four steps and the time on each connector, and the 1.6s loop on .m6flw-dash. */
.m6flw { --m6flw-bg: #efe5d6; --m6flw-card: #fbf6ee; --m6flw-ink: #2b2118; --m6flw-quiet: #625446; --m6flw-line: #dccdb8; --m6flw-focus: #2b2118; --m6flw-wire: #b5562f; }
.m6flw { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6flw *, .m6flw *::before, .m6flw *::after { box-sizing: border-box; }
.m6flw svg { display: block; overflow: visible; }
.m6flw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6flw-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6flw-line); border-radius: 999px; background: transparent; color: var(--m6flw-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6flw-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6flw-replay:hover { color: var(--m6flw-ink); }
.m6flw-replay:focus-visible { outline: 2px solid var(--m6flw-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6flw.is-js:not([data-run]) .m6flw-gy { transform: scaleY(0); }
  .m6flw.is-js:not([data-run]) .m6flw-gx { transform: scaleX(0); }
  .m6flw.is-js:not([data-run]) .m6flw-f { opacity: 0; }
  .m6flw.is-js:not([data-run]) .m6flw-o { opacity: 0; }
  .m6flw.is-js:not([data-run]) .m6flw-d { stroke-dashoffset: var(--m6flw-len, 1); }
  .m6flw.is-js:not([data-run]) .m6flw-pop { opacity: 0; }
}
.m6flw[data-run] .m6flw-gy { animation: m6flw-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6flw[data-run] .m6flw-gx { animation: m6flw-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6flw[data-run] .m6flw-f { animation: m6flw-f .45s ease-out both; }
.m6flw[data-run] .m6flw-o { animation: m6flw-o .6s ease-out both; }
.m6flw[data-run] .m6flw-d { animation: m6flw-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6flw[data-run] .m6flw-pop { animation: m6flw-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6flw-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6flw-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6flw-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6flw-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6flw-d { from { stroke-dashoffset: var(--m6flw-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6flw-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6flw[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6flw *, .m6flw *::before, .m6flw *::after { animation: none !important; transition: none !important; }
  .m6flw-replay { display: none; }
}

.m6flw { background: var(--m6flw-bg); color: var(--m6flw-ink); padding: 52px clamp(16px, 4vw, 56px) 84px; }
.m6flw-wrap { max-width: 1120px; margin: 0 auto; }
.m6flw-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6flw-wire); }
.m6flw-h { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(28px, 3.6vw, 38px); line-height: 1.1; }
.m6flw-lede { margin: 12px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--m6flw-quiet); max-width: 36em; }
.m6flw-flow { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr) 76px minmax(0, 1fr) 76px minmax(0, 1fr); align-items: stretch; }
.m6flw-node { padding: 20px 18px 22px; background: var(--m6flw-card); border: 1px solid var(--m6flw-line); border-radius: 12px; box-shadow: 0 18px 30px -26px rgba(43, 33, 24, .55); }
.m6flw-ic { width: 32px; height: 32px; fill: none; stroke: var(--m6flw-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6flw-step { display: block; margin-top: 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--m6flw-quiet); }
.m6flw-nh { margin: 4px 0 0; font-size: 17px; font-weight: 650; }
.m6flw-np { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--m6flw-quiet); }
.m6flw-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.m6flw-wire { width: 64px; height: 24px; }
.m6flw-wire path { fill: none; stroke: var(--m6flw-wire); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m6flw-dash { stroke-dasharray: 3 7; }
/* The only loop: the dash pattern slides toward the arrow head, paused off screen. */
.m6flw[data-run] .m6flw-dash { animation: m6flw-flow 1.6s linear infinite; }
@keyframes m6flw-flow { from { stroke-dashoffset: 10; } to { stroke-dashoffset: 0; } }
.m6flw-time { font-size: 12px; font-weight: 600; color: var(--m6flw-wire); white-space: nowrap; }
.m6flw-cap { margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--m6flw-line); font-size: 12.5px; color: var(--m6flw-quiet); padding-right: 110px; }
@media (max-width: 860px) {
  .m6flw-flow { grid-template-columns: 1fr; max-width: 460px; }
  .m6flw-link { flex-direction: row; height: 56px; gap: 10px; }
  .m6flw-wire { transform: rotate(90deg); width: 44px; }
}

.m6flw[data-run] .m6flw-t0 { animation-delay: 0.00s; }
.m6flw[data-run] .m6flw-t1 { animation-delay: 0.10s; }
.m6flw[data-run] .m6flw-t2 { animation-delay: 0.20s; }
.m6flw[data-run] .m6flw-t3 { animation-delay: 0.30s; }
.m6flw[data-run] .m6flw-t4 { animation-delay: 0.40s; }
.m6flw[data-run] .m6flw-t5 { animation-delay: 0.50s; }
.m6flw[data-run] .m6flw-t6 { animation-delay: 0.60s; }
.m6flw[data-run] .m6flw-t7 { animation-delay: 0.70s; }
.m6flw[data-run] .m6flw-t8 { animation-delay: 0.80s; }
.m6flw[data-run] .m6flw-t9 { animation-delay: 0.90s; }
.m6flw[data-run] .m6flw-t10 { animation-delay: 1.00s; }
.m6flw[data-run] .m6flw-t11 { animation-delay: 1.10s; }
.m6flw[data-run] .m6flw-t12 { animation-delay: 1.20s; }
.m6flw[data-run] .m6flw-t13 { animation-delay: 1.30s; }
.m6flw[data-run] .m6flw-t14 { animation-delay: 1.40s; }
.m6flw[data-run] .m6flw-t15 { animation-delay: 1.50s; }
.m6flw[data-run] .m6flw-t16 { animation-delay: 1.60s; }
.m6flw[data-run] .m6flw-t17 { animation-delay: 1.70s; }
.m6flw[data-run] .m6flw-t18 { animation-delay: 1.80s; }
.m6flw[data-run] .m6flw-t19 { animation-delay: 1.90s; }
.m6flw[data-run] .m6flw-t20 { animation-delay: 2.00s; }
.m6flw[data-run] .m6flw-t21 { animation-delay: 2.10s; }
.m6flw[data-run] .m6flw-t22 { animation-delay: 2.20s; }
.m6flw[data-run] .m6flw-t23 { animation-delay: 2.30s; }
.m6flw[data-run] .m6flw-t24 { animation-delay: 2.40s; }
.m6flw[data-run] .m6flw-t25 { animation-delay: 2.50s; }
.m6flw[data-run] .m6flw-t26 { animation-delay: 2.60s; }
.m6flw[data-run] .m6flw-t27 { animation-delay: 2.70s; }
.m6flw[data-run] .m6flw-t28 { animation-delay: 2.80s; }
.m6flw[data-run] .m6flw-t29 { animation-delay: 2.90s; }
.m6flw[data-run] .m6flw-t30 { animation-delay: 3.00s; }
.m6flw[data-run] .m6flw-t31 { animation-delay: 3.10s; }
.m6flw[data-run] .m6flw-t32 { animation-delay: 3.20s; }
.m6flw[data-run] .m6flw-t33 { animation-delay: 3.30s; }
.m6flw[data-run] .m6flw-t34 { animation-delay: 3.40s; }
.m6flw[data-run] .m6flw-t35 { animation-delay: 3.50s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6flw").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6flw-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: The four steps and the arrows between them are shown still, with every typical time in view.

Running cost: Three short dashed lines repaint as their pattern slides, which is light, and the loop pauses with animation-play-state when the diagram leaves the screen.

  • Change the connector colour with `--m6flw-wire`.
  • Slow the moving dashes by raising the 1.6s on the `.m6flw-dash` animation, or set it to none for still lines.
  • Edit the steps and the time on each connector in the list markup; three to five steps fit the row.

Class Bookings Ranked as Horizontal Bars

A ranking card for a pottery studio's end of term notes. Five classes are listed in order, each bar sweeping out from the left with scaleX a beat after the one above, and the booking count appears at the tip once the bar has arrived. On narrow screens the class name sits above its bar so long names never get squeezed.

<section class="m6rnk">
<div class="m6rnk-card">
  <div class="m6rnk-head">
    <div>
      <p class="m6rnk-eyebrow">Kiln Lane Studio · Autumn term</p>
      <h2 class="m6rnk-h">Bookings by class</h2>
    </div>
    <p class="m6rnk-lede">Wheel throwing for beginners filled the most places, more than three times the raku day.</p>
  </div>
  <figure class="m6rnk-fig">
    <div role="img" aria-label="Ranked bar chart of autumn term bookings. Wheel throwing for beginners leads with 64, then hand-building 51, glazing evening 38, family clay morning 33 and raku firing day 19.">
      <ol class="m6rnk-list" aria-hidden="true">
    <li class="m6rnk-row m6rnk-r0">
      <span class="m6rnk-num">01</span>
      <span class="m6rnk-name">Wheel throwing for beginners</span>
      <span class="m6rnk-track"><span class="m6rnk-bar m6rnk-gx m6rnk-t0"></span><span class="m6rnk-val m6rnk-f m6rnk-t6">64</span></span>
    </li>
    <li class="m6rnk-row m6rnk-r1">
      <span class="m6rnk-num">02</span>
      <span class="m6rnk-name">Hand-building with slabs</span>
      <span class="m6rnk-track"><span class="m6rnk-bar m6rnk-gx m6rnk-t1"></span><span class="m6rnk-val m6rnk-f m6rnk-t7">51</span></span>
    </li>
    <li class="m6rnk-row m6rnk-r2">
      <span class="m6rnk-num">03</span>
      <span class="m6rnk-name">Glazing evening</span>
      <span class="m6rnk-track"><span class="m6rnk-bar m6rnk-gx m6rnk-t2"></span><span class="m6rnk-val m6rnk-f m6rnk-t8">38</span></span>
    </li>
    <li class="m6rnk-row m6rnk-r3">
      <span class="m6rnk-num">04</span>
      <span class="m6rnk-name">Family clay morning</span>
      <span class="m6rnk-track"><span class="m6rnk-bar m6rnk-gx m6rnk-t3"></span><span class="m6rnk-val m6rnk-f m6rnk-t9">33</span></span>
    </li>
    <li class="m6rnk-row m6rnk-r4">
      <span class="m6rnk-num">05</span>
      <span class="m6rnk-name">Raku firing day</span>
      <span class="m6rnk-track"><span class="m6rnk-bar m6rnk-gx m6rnk-t4"></span><span class="m6rnk-val m6rnk-f m6rnk-t10">19</span></span>
    </li>
      </ol>
    </div>
    <ul class="m6rnk-sr">
    <li>Wheel throwing for beginners: 64 bookings</li>
    <li>Hand-building with slabs: 51 bookings</li>
    <li>Glazing evening: 38 bookings</li>
    <li>Family clay morning: 33 bookings</li>
    <li>Raku firing day: 19 bookings</li>
    </ul>
    <figcaption class="m6rnk-cap">Sample figures for an invented studio. Places booked across the twelve-week term.</figcaption>
  </figure>
</div>
<button type="button" class="m6rnk-replay" aria-label="Replay the chart"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M4.5 11a5.5 5.5 0 1 0 1.8-4.6"/><path d="M5 3.2v3.6h3.6"/></svg>Replay</button>
</section>
<style>
/* Edit these first: the bar colours at the top of .m6rnk, the --v value on each .m6rnk-r rule and --m6rnk-max (the value that fills a whole track). */
.m6rnk { --m6rnk-bg: #e9edf2; --m6rnk-card: #ffffff; --m6rnk-ink: #17222f; --m6rnk-quiet: #4c5a69; --m6rnk-line: #dce2e9; --m6rnk-focus: #23395b; --m6rnk-bar: #9fb1c7; --m6rnk-hi: #23395b; --m6rnk-max: 72; }
.m6rnk { position: relative; box-sizing: border-box; overflow: hidden; font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.m6rnk *, .m6rnk *::before, .m6rnk *::after { box-sizing: border-box; }
.m6rnk svg { display: block; overflow: visible; }
.m6rnk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m6rnk-replay { position: absolute; right: 14px; bottom: 14px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--m6rnk-line); border-radius: 999px; background: transparent; color: var(--m6rnk-quiet); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m6rnk-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m6rnk-replay:hover { color: var(--m6rnk-ink); }
.m6rnk-replay:focus-visible { outline: 2px solid var(--m6rnk-focus); outline-offset: 2px; }
/* Start state, only when motion is allowed and the script is running, so the chart is never blank without it. */
@media (prefers-reduced-motion: no-preference) {
  .m6rnk.is-js:not([data-run]) .m6rnk-gy { transform: scaleY(0); }
  .m6rnk.is-js:not([data-run]) .m6rnk-gx { transform: scaleX(0); }
  .m6rnk.is-js:not([data-run]) .m6rnk-f { opacity: 0; }
  .m6rnk.is-js:not([data-run]) .m6rnk-o { opacity: 0; }
  .m6rnk.is-js:not([data-run]) .m6rnk-d { stroke-dashoffset: var(--m6rnk-len, 1); }
  .m6rnk.is-js:not([data-run]) .m6rnk-pop { opacity: 0; }
}
.m6rnk[data-run] .m6rnk-gy { animation: m6rnk-gy .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6rnk[data-run] .m6rnk-gx { animation: m6rnk-gx .75s cubic-bezier(.2, .75, .25, 1) both; }
.m6rnk[data-run] .m6rnk-f { animation: m6rnk-f .45s ease-out both; }
.m6rnk[data-run] .m6rnk-o { animation: m6rnk-o .6s ease-out both; }
.m6rnk[data-run] .m6rnk-d { animation: m6rnk-d .7s cubic-bezier(.45, .05, .3, 1) both; }
.m6rnk[data-run] .m6rnk-pop { animation: m6rnk-pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes m6rnk-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes m6rnk-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes m6rnk-f { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes m6rnk-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes m6rnk-d { from { stroke-dashoffset: var(--m6rnk-len, 1); } to { stroke-dashoffset: 0; } }
@keyframes m6rnk-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
/* Paused while scrolled out of view. */
.m6rnk[data-off] * { animation-play-state: paused !important; }
/* Reduced motion: the finished chart at its values, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .m6rnk *, .m6rnk *::before, .m6rnk *::after { animation: none !important; transition: none !important; }
  .m6rnk-replay { display: none; }
}

.m6rnk { background: var(--m6rnk-bg); color: var(--m6rnk-ink); padding: 48px clamp(16px, 4vw, 48px) 80px; }
.m6rnk-card { max-width: 860px; margin: 0 auto; padding: 32px clamp(18px, 4vw, 40px) 26px; background: var(--m6rnk-card); border: 1px solid var(--m6rnk-line); border-radius: 12px; box-shadow: 0 26px 48px -36px rgba(23, 34, 47, .45); }
.m6rnk-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 32px; align-items: end; }
.m6rnk-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--m6rnk-quiet); }
.m6rnk-h { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.m6rnk-lede { margin: 0; font-size: 15px; line-height: 1.55; color: var(--m6rnk-quiet); }
.m6rnk-fig { margin: 28px 0 0; }
.m6rnk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.m6rnk-row { display: grid; grid-template-columns: 30px minmax(0, 220px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--m6rnk-line); }
.m6rnk-row:first-child { border-top: 0; }
.m6rnk-num { font-size: 12px; font-weight: 600; color: var(--m6rnk-quiet); letter-spacing: .04em; }
.m6rnk-name { font-size: 15px; font-weight: 500; }
.m6rnk-track { position: relative; display: flex; align-items: center; gap: 10px; height: 28px; }
.m6rnk-bar { display: block; height: 100%; width: calc(var(--v) / var(--m6rnk-max) * (100% - 40px)); background: var(--m6rnk-bar); border-radius: 0 6px 6px 0; transform-origin: 0 50%; }
.m6rnk-r0 .m6rnk-bar { background: var(--m6rnk-hi); }
.m6rnk-val { font-size: 15px; font-weight: 650; }
.m6rnk-cap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--m6rnk-line); font-size: 12.5px; color: var(--m6rnk-quiet); padding-right: 96px; }
@media (max-width: 620px) {
  .m6rnk-head { grid-template-columns: 1fr; }
  .m6rnk-row { grid-template-columns: 26px minmax(0, 1fr); row-gap: 6px; }
  .m6rnk-track { grid-column: 2; height: 22px; }
}
.m6rnk-r0 { --v: 64; }
.m6rnk-r1 { --v: 51; }
.m6rnk-r2 { --v: 38; }
.m6rnk-r3 { --v: 33; }
.m6rnk-r4 { --v: 19; }
.m6rnk[data-run] .m6rnk-t0 { animation-delay: 0.00s; }
.m6rnk[data-run] .m6rnk-t1 { animation-delay: 0.09s; }
.m6rnk[data-run] .m6rnk-t2 { animation-delay: 0.18s; }
.m6rnk[data-run] .m6rnk-t3 { animation-delay: 0.27s; }
.m6rnk[data-run] .m6rnk-t4 { animation-delay: 0.36s; }
.m6rnk[data-run] .m6rnk-t5 { animation-delay: 0.45s; }
.m6rnk[data-run] .m6rnk-t6 { animation-delay: 0.54s; }
.m6rnk[data-run] .m6rnk-t7 { animation-delay: 0.63s; }
.m6rnk[data-run] .m6rnk-t8 { animation-delay: 0.72s; }
.m6rnk[data-run] .m6rnk-t9 { animation-delay: 0.81s; }
.m6rnk[data-run] .m6rnk-t10 { animation-delay: 0.90s; }
.m6rnk[data-run] .m6rnk-t11 { animation-delay: 0.99s; }
.m6rnk[data-run] .m6rnk-t12 { animation-delay: 1.08s; }
.m6rnk[data-run] .m6rnk-t13 { animation-delay: 1.17s; }
.m6rnk[data-run] .m6rnk-t14 { animation-delay: 1.26s; }
.m6rnk[data-run] .m6rnk-t15 { animation-delay: 1.35s; }
.m6rnk[data-run] .m6rnk-t16 { animation-delay: 1.44s; }
.m6rnk[data-run] .m6rnk-t17 { animation-delay: 1.53s; }
.m6rnk[data-run] .m6rnk-t18 { animation-delay: 1.62s; }
.m6rnk[data-run] .m6rnk-t19 { animation-delay: 1.71s; }
.m6rnk[data-run] .m6rnk-t20 { animation-delay: 1.80s; }
.m6rnk[data-run] .m6rnk-t21 { animation-delay: 1.89s; }
.m6rnk[data-run] .m6rnk-t22 { animation-delay: 1.98s; }
.m6rnk[data-run] .m6rnk-t23 { animation-delay: 2.07s; }
.m6rnk[data-run] .m6rnk-t24 { animation-delay: 2.16s; }
.m6rnk[data-run] .m6rnk-t25 { animation-delay: 2.25s; }
.m6rnk[data-run] .m6rnk-t26 { animation-delay: 2.34s; }
.m6rnk[data-run] .m6rnk-t27 { animation-delay: 2.43s; }
.m6rnk[data-run] .m6rnk-t28 { animation-delay: 2.52s; }
.m6rnk[data-run] .m6rnk-t29 { animation-delay: 2.61s; }
.m6rnk[data-run] .m6rnk-t30 { animation-delay: 2.70s; }
.m6rnk[data-run] .m6rnk-t31 { animation-delay: 2.79s; }
.m6rnk[data-run] .m6rnk-t32 { animation-delay: 2.88s; }
.m6rnk[data-run] .m6rnk-t33 { animation-delay: 2.97s; }
.m6rnk[data-run] .m6rnk-t34 { animation-delay: 3.06s; }
.m6rnk[data-run] .m6rnk-t35 { animation-delay: 3.15s; }
</style>
<script>
(function () {
  // Plays once when the piece enters the view (works inside a scrolling box too) and pauses any loop when it leaves.
  document.querySelectorAll(".m6rnk").forEach(function (root) {
    root.classList.add("is-js");
    function play() {
      root.removeAttribute("data-run");
      void root.offsetWidth; // restart the keyframes
      root.setAttribute("data-run", "");
    }
    var btn = root.querySelector(".m6rnk-replay"), seen = false;
    if (btn) btn.addEventListener("click", play);
    if (!("IntersectionObserver" in window)) return play();
    new IntersectionObserver(function (es) {
      var on = es[0].isIntersecting;
      root.toggleAttribute("data-off", !on);
      if (on && !seen) { seen = true; play(); }
    }, { threshold: 0.2 }).observe(root);
  });
})();
</script>

With reduced motion: The ranking is shown complete, each bar at its length with its count beside it.

Running cost: Five bars scale and five numbers fade on the compositor in just over a second; after that nothing runs.

  • Change each class's value with `--v` on its `.m6rnk-r` rule, and set `--m6rnk-max` a little above the largest value.
  • Recolour the leader with `--m6rnk-hi` and the rest with `--m6rnk-bar`.
  • Adjust the stagger by changing the step in the `.m6rnk-t` delay rules.

Performance notes

A bar that grows with transform does not change the chart's layout, so the browser composites it. Lines and arcs drawn with stroke-dashoffset repaint as they draw, which is cheap for a handful of paths. After the entrance, everything stops.

Flow lines are the only loops. They move a dash pattern slowly and pause with animation-play-state when the diagram is off screen. For dashboards with hundreds of points, a charting library or canvas will scale better than hand-written SVG.

Questions

How do I animate a bar chart in CSS?

Draw each bar at its full height, set transform-origin to its bottom edge and start it at transform: scaleY(0). When the chart enters the screen, transition it to scaleY(1) with a short stagger between bars. The layout never changes, so the motion stays smooth.

How do I animate a pie or donut chart?

Draw each slice as a circle stroke with pathLength="100" so its dash length equals its percentage. Rotate each circle to start where the previous slice ended, then animate stroke-dashoffset from the slice size to 0.

Are animated charts accessible?

They can be. Give the SVG role img and a label that states the main finding, keep every value as text, offer the data as a table, and show the finished chart for people who prefer reduced motion.

When should I use a chart library instead?

When data changes live, has many points, or needs tooltips, zooming and axes that rescale. Hand-written SVG suits a few fixed figures on a marketing page or report, which is what these pieces are for.

Also in the gallery: Area Chart Gains Data Per Step.

More collections: Number Counter Animations, SVG Line Drawing Animations: Paths That Draw Themselves, Scrollytelling Sections in HTML, CSS and React. All motion graphics. Build your site free to have a full site built around them.

Product

Who It's For

Features

Resources

Company

View Sitemap