Bar Chart
Compare adjacent categories on a shared linear scale.
- Shipped
- Planned
Inspect a point or use the arrow keys
View chart data
| Category | Shipped | Planned |
|---|---|---|
| Mon | 32 | 35 |
| Tue | 39 | 41 |
| Wed | 33 | 32 |
| Thu | 46 | 48 |
| Fri | 56 | 52 |
| Sat | 38 | 36 |
| Sun | 40 | 42 |
HTML
<figure class="rl-plot" data-rl-chart="bar">
<figcaption><strong>Weekly dispatch plan</strong><span>Studio dispatch · sample week</span></figcaption>
<ul class="rl-plot-legend" aria-label="Series"><li><i class="rl-plot-tone-0" aria-hidden="true"></i>Shipped</li><li><i class="rl-plot-tone-1" aria-hidden="true"></i>Planned</li></ul>
<svg viewBox="0 0 495 188" role="group" aria-label="Weekly dispatch plan"><desc>Use the arrow keys to explore values. Open the data table for all values.</desc><line class="rl-plot-grid" x1="42" x2="480" y1="155" y2="155"/><text class="rl-plot-axis" x="35" y="159" text-anchor="end">0</text><line class="rl-plot-grid" x1="42" x2="480" y1="85.5" y2="85.5"/><text class="rl-plot-axis" x="35" y="89.5" text-anchor="end">28</text><line class="rl-plot-grid" x1="42" x2="480" y1="16" y2="16"/><text class="rl-plot-axis" x="35" y="20" text-anchor="end">56</text><text class="rl-plot-axis" x="73.29" y="179" text-anchor="middle">Mon</text><text class="rl-plot-axis" x="135.86" y="179" text-anchor="middle">Tue</text><text class="rl-plot-axis" x="198.43" y="179" text-anchor="middle">Wed</text><text class="rl-plot-axis" x="261" y="179" text-anchor="middle">Thu</text><text class="rl-plot-axis" x="323.57" y="179" text-anchor="middle">Fri</text><text class="rl-plot-axis" x="386.14" y="179" text-anchor="middle">Sat</text><text class="rl-plot-axis" x="448.71" y="179" text-anchor="middle">Sun</text><g class="rl-plot-point rl-plot-tone-0" tabindex="0" role="img" aria-label="Mon · Shipped: 32" data-rl-series="0" data-rl-plot-value="Mon · Shipped: 32"><rect x="55.15" y="75.57" width="16.88" height="79.43" rx="2"/></g><g class="rl-plot-point rl-plot-tone-0" tabindex="-1" role="img" aria-label="Tue · Shipped: 39" data-rl-series="0" data-rl-plot-value="Tue · Shipped: 39"><rect x="117.72" y="58.2" width="16.88" height="96.8" rx="2"/></g><g class="rl-plot-point rl-plot-tone-0" tabindex="-1" role="img" aria-label="Wed · Shipped: 33" data-rl-series="0" data-rl-plot-value="Wed · Shipped: 33"><rect x="180.29" y="73.09" width="16.88" height="81.91" rx="2"/></g><g class="rl-plot-point rl-plot-tone-0" tabindex="-1" role="img" aria-label="Thu · Shipped: 46" data-rl-series="0" data-rl-plot-value="Thu · Shipped: 46"><rect x="242.86" y="40.82" width="16.88" height="114.18" rx="2"/></g><g class="rl-plot-point rl-plot-tone-0" tabindex="-1" role="img" aria-label="Fri · Shipped: 56" data-rl-series="0" data-rl-plot-value="Fri · Shipped: 56"><rect x="305.44" y="16" width="16.88" height="139" rx="2"/></g><g class="rl-plot-point rl-plot-tone-0" tabindex="-1" role="img" aria-label="Sat · Shipped: 38" data-rl-series="0" data-rl-plot-value="Sat · Shipped: 38"><rect x="368.01" y="60.68" width="16.88" height="94.32" rx="2"/></g><g class="rl-plot-point rl-plot-tone-0" tabindex="-1" role="img" aria-label="Sun · Shipped: 40" data-rl-series="0" data-rl-plot-value="Sun · Shipped: 40"><rect x="430.58" y="55.71" width="16.88" height="99.29" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Mon · Planned: 35" data-rl-series="1" data-rl-plot-value="Mon · Planned: 35"><rect x="74.55" y="68.13" width="16.88" height="86.88" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Tue · Planned: 41" data-rl-series="1" data-rl-plot-value="Tue · Planned: 41"><rect x="137.12" y="53.23" width="16.88" height="101.77" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Wed · Planned: 32" data-rl-series="1" data-rl-plot-value="Wed · Planned: 32"><rect x="199.69" y="75.57" width="16.88" height="79.43" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Thu · Planned: 48" data-rl-series="1" data-rl-plot-value="Thu · Planned: 48"><rect x="262.26" y="35.86" width="16.88" height="119.14" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Fri · Planned: 52" data-rl-series="1" data-rl-plot-value="Fri · Planned: 52"><rect x="324.83" y="25.93" width="16.88" height="129.07" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Sat · Planned: 36" data-rl-series="1" data-rl-plot-value="Sat · Planned: 36"><rect x="387.4" y="65.64" width="16.88" height="89.36" rx="2"/></g><g class="rl-plot-point rl-plot-tone-1" tabindex="-1" role="img" aria-label="Sun · Planned: 42" data-rl-series="1" data-rl-plot-value="Sun · Planned: 42"><rect x="449.98" y="50.75" width="16.88" height="104.25" rx="2"/></g></svg>
<span class="rl-plot-tooltip" data-rl-plot-tooltip aria-hidden="true" hidden></span>
<div class="rl-plot-readout" data-rl-plot-readout>Inspect a point or use the arrow keys</div>
<details class="rl-plot-data"><summary>View chart data</summary><div><table class="rl-table"><caption>Weekly dispatch plan</caption><thead><tr><th scope="col">Category</th><th scope="col">Shipped</th><th scope="col">Planned</th></tr></thead>
<tbody><tr><th scope="row">Mon</th><td>32</td><td>35</td></tr><tr><th scope="row">Tue</th><td>39</td><td>41</td></tr><tr><th scope="row">Wed</th><td>33</td><td>32</td></tr><tr><th scope="row">Thu</th><td>46</td><td>48</td></tr><tr><th scope="row">Fri</th><td>56</td><td>52</td></tr><tr><th scope="row">Sat</th><td>38</td><td>36</td></tr><tr><th scope="row">Sun</th><td>40</td><td>42</td></tr></tbody></table></div></details>
</figure>The SVG and data table share one dataset. Tab into the chart once. Arrow left and right inspect categories. Arrow up and down change series. The next Tab reaches the data table. The optional insight-charts.mjs helper renders this HTML on your server.
Use in your app
Copy these tags into your page head once. Serve the files at the paths shown, then add the example’s template to your page.
Page assets
<link rel="stylesheet" href="/mero.css">
<link rel="stylesheet" href="/mero-insights.css">
<script defer src="/mero.js"></script>
<script defer src="/mero-insights.js"></script>Optional server helper · insight-charts.mjs ↓
Download library and examples ↓