chartlet 0.1.0-alpha.3

Compile structured data into deterministic, accessible static charts
Documentation
1
<figure class="chartlet-figure"><figcaption>Headcount</figcaption><svg xmlns="http://www.w3.org/2000/svg" width="800" height="450" viewBox="0 0 800 450" role="img" aria-labelledby="chartlet-e589c18f6a100517-title chartlet-e589c18f6a100517-description" class="chartlet-root"><title id="chartlet-e589c18f6a100517-title">Headcount</title><desc id="chartlet-e589c18f6a100517-description">Headcount rose steadily from January to August.</desc><style>.chartlet-root{max-width:100%;height:auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif;color:#172033}.chartlet-title{font-size:22px;font-weight:650;fill:#172033}.chartlet-label,.chartlet-tick,.chartlet-value,.chartlet-value-inverse,.chartlet-axis-title{font-size:12px;fill:#344054}.chartlet-value,.chartlet-value-inverse{font-weight:600}.chartlet-value{fill:#172033}.chartlet-value-inverse{fill:#fff}.chartlet-axis-title{font-weight:600}.chartlet-grid{stroke:#d9dee8;stroke-width:1}.chartlet-zero{stroke:#667085;stroke-width:1.5}.chartlet-bar,.chartlet-point{fill:#2563eb}.chartlet-line{fill:none;stroke:#2563eb;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}</style><text x="72" y="30" text-anchor="start" class="chartlet-title">Headcount</text><line x1="72" y1="368" x2="776" y2="368" class="chartlet-grid"/><text x="62" y="372" text-anchor="end" class="chartlet-tick">40</text><line x1="72" y1="271.333" x2="776" y2="271.333" class="chartlet-grid"/><text x="62" y="275.333" text-anchor="end" class="chartlet-tick">50</text><line x1="72" y1="174.667" x2="776" y2="174.667" class="chartlet-grid"/><text x="62" y="178.667" text-anchor="end" class="chartlet-tick">60</text><line x1="72" y1="78" x2="776" y2="78" class="chartlet-grid"/><text x="62" y="82" text-anchor="end" class="chartlet-tick">70</text><text x="72" y="58" text-anchor="start" class="chartlet-axis-title">Employees</text><circle cx="78" cy="348.667" r="4" class="chartlet-point"><title>January: 42</title></circle><text x="78" y="338.667" text-anchor="middle" class="chartlet-value">42</text><text x="78" y="392" text-anchor="middle" class="chartlet-label">January</text><circle cx="176.857" cy="329.333" r="4" class="chartlet-point"><title>February: 44</title></circle><text x="176.857" y="319.333" text-anchor="middle" class="chartlet-value">44</text><text x="176.857" y="392" text-anchor="middle" class="chartlet-label">February</text><circle cx="275.714" cy="300.333" r="4" class="chartlet-point"><title>March: 47</title></circle><text x="275.714" y="290.333" text-anchor="middle" class="chartlet-value">47</text><text x="275.714" y="392" text-anchor="middle" class="chartlet-label">March</text><circle cx="374.571" cy="271.333" r="4" class="chartlet-point"><title>April: 50</title></circle><text x="374.571" y="261.333" text-anchor="middle" class="chartlet-value">50</text><text x="374.571" y="392" text-anchor="middle" class="chartlet-label">April</text><circle cx="473.429" cy="232.667" r="4" class="chartlet-point"><title>May: 54</title></circle><text x="473.429" y="222.667" text-anchor="middle" class="chartlet-value">54</text><text x="473.429" y="392" text-anchor="middle" class="chartlet-label">May</text><circle cx="572.286" cy="194" r="4" class="chartlet-point"><title>June: 58</title></circle><text x="572.286" y="184" text-anchor="middle" class="chartlet-value">58</text><text x="572.286" y="392" text-anchor="middle" class="chartlet-label">June</text><circle cx="671.143" cy="165" r="4" class="chartlet-point"><title>July: 61</title></circle><text x="671.143" y="155" text-anchor="middle" class="chartlet-value">61</text><text x="671.143" y="392" text-anchor="middle" class="chartlet-label">July</text><circle cx="770" cy="116.667" r="4" class="chartlet-point"><title>August: 66</title></circle><text x="770" y="106.667" text-anchor="middle" class="chartlet-value">66</text><text x="770" y="392" text-anchor="middle" class="chartlet-label">August</text><polyline points="78,348.667 176.857,329.333 275.714,300.333 374.571,271.333 473.429,232.667 572.286,194 671.143,165 770,116.667" class="chartlet-line"/><text x="424" y="436" text-anchor="middle" class="chartlet-axis-title">Month</text></svg><p class="chartlet-source">Source: Example data</p><details class="chartlet-data"><summary>Show chart data</summary><table><caption>Data for Headcount</caption><thead><tr><th scope="col">Category</th><th scope="col">Value</th></tr></thead><tbody><tr><th scope="row">January</th><td>42</td></tr><tr><th scope="row">February</th><td>44</td></tr><tr><th scope="row">March</th><td>47</td></tr><tr><th scope="row">April</th><td>50</td></tr><tr><th scope="row">May</th><td>54</td></tr><tr><th scope="row">June</th><td>58</td></tr><tr><th scope="row">July</th><td>61</td></tr><tr><th scope="row">August</th><td>66</td></tr></tbody></table></details></figure>