Charts and graphs
Choose a chart to explore comparisons, trends, shares or relationships.
Bar chart
Compare categories against a shared zero baseline.
View data table
| Subject | Saved | Shared |
|---|---|---|
| Coast | 32 | 12 |
| City | 24 | 15 |
| Forest | 18 | 9 |
| Highlands | 12 | 5 |
View markup
<figure class="ex-chart" data-ex-chart="bar">
<figcaption>Notebook activity by subject</figcaption>
<details open>
<summary>View data table</summary>
<table><caption>Notebook activity by subject</caption>
<thead><tr><th scope="col">Subject</th><th scope="col" data-ex-summary="Coast had the most saves (32), followed by City (24).">Saved</th><th scope="col" data-ex-summary="City had the most shares (15), three more than Coast.">Shared</th></tr></thead>
<tbody><tr><th scope="row">Coast</th><td>32</td><td>12</td></tr><tr><th scope="row">City</th><td>24</td><td>15</td></tr><tr><th scope="row">Forest</th><td>18</td><td>9</td></tr><tr><th scope="row">Highlands</th><td>12</td><td>5</td></tr></tbody>
</table>
</details>
</figure>Use in a projectLine graph
Follow a measure over equally spaced intervals. A gap means no observation.
View data table
| Week | Saved | Shared |
|---|---|---|
| Week 1 | 12 | 5 |
| Week 2 | 18 | 7 |
| Week 3 | 15 | No data |
| Week 4 | 23 | 9 |
| Week 5 | 26 | 13 |
| Week 6 | 30 | 16 |
View markup
<figure class="ex-chart" data-ex-chart="line">
<figcaption>Notebook activity by week</figcaption>
<details open>
<summary>View data table</summary>
<table><caption>Notebook activity by week</caption>
<thead><tr><th scope="col">Week</th><th scope="col" data-ex-summary="Weekly saves rose from 12 to 30, with a dip in week 3.">Saved</th><th scope="col" data-ex-summary="Weekly shares rose from 5 to 16. Week 3 has no reading.">Shared</th></tr></thead>
<tbody><tr><th scope="row">Week 1</th><td>12</td><td>5</td></tr><tr><th scope="row">Week 2</th><td>18</td><td>7</td></tr><tr><th scope="row">Week 3</th><td>15</td><td data-ex-missing>No data</td></tr><tr><th scope="row">Week 4</th><td>23</td><td>9</td></tr><tr><th scope="row">Week 5</th><td>26</td><td>13</td></tr><tr><th scope="row">Week 6</th><td>30</td><td>16</td></tr></tbody>
</table>
</details>
</figure>Use in a projectMulti-series line chart
Compare trends on the same scale. Select the series to show.
View data table
| Week | Trail guides | City guides |
|---|---|---|
| Week 1 | 18 | 35 |
| Week 2 | 24 | 31 |
| Week 3 | 28 | No data |
| Week 4 | 31 | 33 |
| Week 5 | 38 | 30 |
| Week 6 | 42 | 27 |
View markup
<figure class="ex-chart" data-ex-chart="multi-line">
<figcaption>Guide visits by week</figcaption>
<details open>
<summary>View data table</summary>
<table><caption>Guide visits by week</caption>
<thead><tr><th scope="col">Week</th><th scope="col" data-ex-summary="Trail visits rose from 18 to 42.">Trail guides</th><th scope="col" data-ex-summary="City visits fell from 35 to 27. Week 3 has no reading.">City guides</th></tr></thead>
<tbody><tr><th scope="row">Week 1</th><td>18</td><td>35</td></tr><tr><th scope="row">Week 2</th><td>24</td><td>31</td></tr><tr><th scope="row">Week 3</th><td>28</td><td data-ex-missing>No data</td></tr><tr><th scope="row">Week 4</th><td>31</td><td>33</td></tr><tr><th scope="row">Week 5</th><td>38</td><td>30</td></tr><tr><th scope="row">Week 6</th><td>42</td><td>27</td></tr></tbody>
</table>
</details>
</figure>Use in a projectGrouped bar chart
Compare several measures within each category, including gains and losses.
View data table
| Subject | May | June |
|---|---|---|
| Coast | 12 | 8 |
| City | -4 | 6 |
| Forest | 3 | -2 |
View markup
<figure class="ex-chart" data-ex-chart="grouped-bar">
<figcaption>Change in saved notebooks</figcaption>
<details open>
<summary>View data table</summary>
<table><caption>Change in saved notebooks</caption>
<thead><tr><th scope="col">Subject</th><th scope="col" data-ex-summary="In May, Coast gained 12 saves and City lost 4.">May</th><th scope="col" data-ex-summary="In June, Coast gained 8 saves and City gained 6.">June</th></tr></thead>
<tbody><tr><th scope="row">Coast</th><td>12</td><td>8</td></tr><tr><th scope="row">City</th><td>-4</td><td>6</td></tr><tr><th scope="row">Forest</th><td>3</td><td>-2</td></tr></tbody>
</table>
</details>
</figure>Use in a projectPie chart
Show how a few categories divide a whole. Choose a slice to see its share.
Coast accounts for two fifths of the 60 entries.
View data table
| Subject | Entries |
|---|---|
| Coast | 24 |
| City | 18 |
| Forest | 12 |
| Highlands | 6 |
View markup
<figure class="ex-chart ex-data-chart" data-ex-data-chart="pie">
<figcaption>Subjects in the notebook</figcaption>
<p>Coast accounts for two fifths of the 60 entries.</p>
<details open>
<summary>View data table</summary>
<table><caption>Subjects in the notebook</caption>
<thead><tr><th scope="col">Subject</th><th scope="col">Entries</th></tr></thead>
<tbody><tr><th scope="row">Coast</th><td>24</td></tr><tr><th scope="row">City</th><td>18</td></tr><tr><th scope="row">Forest</th><td>12</td></tr><tr><th scope="row">Highlands</th><td>6</td></tr></tbody>
</table>
</details>
</figure>Use in a projectRadar chart
Compare several scores on the same scale. Select an axis to inspect its score.
Shade ranks highest and access lowest on the same five-point scale.
View data table
| Feature | Score |
|---|---|
| Views | 4 |
| Shade | 5 |
| Access | 2 |
| Wayfinding | 4 |
| Quiet | 3 |
View markup
<figure class="ex-chart ex-data-chart" data-ex-data-chart="radar" data-ex-max="5">
<figcaption>Woodland route scores</figcaption>
<p>Shade ranks highest and access lowest on the same five-point scale.</p>
<details open>
<summary>View data table</summary>
<table><caption>Woodland route scores</caption>
<thead><tr><th scope="col">Feature</th><th scope="col">Score</th></tr></thead>
<tbody><tr><th scope="row">Views</th><td>4</td></tr><tr><th scope="row">Shade</th><td>5</td></tr><tr><th scope="row">Access</th><td>2</td></tr><tr><th scope="row">Wayfinding</th><td>4</td></tr><tr><th scope="row">Quiet</th><td>3</td></tr></tbody>
</table>
</details>
</figure>Use in a projectScatter plot
Plot two numeric measures for each observation. Select a point to read both values.
The longest walk recorded fewer species than the woodland walk.
View data table
| Walk | Distance (km) | Bird species |
|---|---|---|
| Canal | 2 | 5 |
| Beach | 3 | 8 |
| Woodland | 4 | 14 |
| Moor | 6 | 9 |
| Ridge | 8 | 11 |
View markup
<figure class="ex-chart ex-data-chart" data-ex-data-chart="scatter">
<figcaption>Distance and bird species on five walks</figcaption>
<p>The longest walk recorded fewer species than the woodland walk.</p>
<details open>
<summary>View data table</summary>
<table><caption>Distance and bird species on five walks</caption>
<thead><tr><th scope="col">Walk</th><th scope="col">Distance (km)</th><th scope="col">Bird species</th></tr></thead>
<tbody><tr><th scope="row">Canal</th><td>2</td><td>5</td></tr><tr><th scope="row">Beach</th><td>3</td><td>8</td></tr><tr><th scope="row">Woodland</th><td>4</td><td>14</td></tr><tr><th scope="row">Moor</th><td>6</td><td>9</td></tr><tr><th scope="row">Ridge</th><td>8</td><td>11</td></tr></tbody>
</table>
</details>
</figure>Use in a projectUse these charts in a project
Copy the example table and load the styles and module listed for that chart in the component index. Place the extracted supplement beside the starter’s vendor/ folder.
Replace the labels, units, values and summary together. Keep related series on a shared scale. Enter a missing observation as missing, so it stays distinct from zero.
