SVG charts without client-side JavaScript
SVG is just markup, so JSX components can draw charts on the server: a few lines of math turn data into coordinates. The charts are part of the HTML, so they show up instantly, need no chart library in the browser, and work with JavaScript turned off. Tooltips use the SVG <title> element, and the hover effects are plain CSS.
Line chart
Show data as table
| City | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Berlin | 0.6 | 1.4 | 4.8 | 9.3 | 14.2 | 17.5 | 19.6 | 19.2 | 15 | 9.9 | 5 | 1.8 |
| Madrid | 6.3 | 7.9 | 11.2 | 12.9 | 16.7 | 22.2 | 25.6 | 25.1 | 20.9 | 15.1 | 9.9 | 6.9 |
| Oslo | -4.3 | -4 | -0.2 | 4.5 | 10.8 | 15.2 | 16.4 | 15.2 | 10.8 | 6.3 | 0.7 | -3.1 |
| Sydney | 23.5 | 23.4 | 22.1 | 19.5 | 16.6 | 14.2 | 13.4 | 14.5 | 17 | 19 | 20.4 | 22.1 |
Bar chart
Sparklines
Small charts fit into a table cell. The dots mark the warmest and the coldest month.
| City | Year | Coldest | Warmest |
|---|---|---|---|
| Berlin | 0.6° (Jan) | 19.6° (Jul) | |
| Madrid | 6.3° (Jan) | 25.6° (Jul) | |
| Oslo | -4.3° (Jan) | 16.4° (Jul) | |
| Sydney | 13.4° (Jul) | 23.5° (Jan) |