---
title: "The uneven race to renewables"
subtitle: "Renewable share of electricity, 2000–2023 (selected countries)"
description: "Renewable share of electricity from 2000 to 2023 across six countries. Denmark rises from 15% to 86% — the standout of the group. Norway holds steady near 99% as a benchmark ceiling. Australia, China, Poland, and India show modest, uneven progress. Built with R and Datawrapper as this challenge's new tool entry."
date: "2026-04-22"
author:
- name: "Steven Ponce"
url: "https://stevenponce.netlify.app"
citation:
url: "https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_22.html"
categories: ["30DayChartChallenge", "2026"]
tags: [
"30DayChartChallenge",
"Timeseries",
"New Tool",
"Datawrapper",
"Energy",
"Renewables",
"Electricity",
"Line Chart",
"Energy Transition",
"Climate",
"Our World in Data",
"Denmark",
"Multi-country"
]
image: "thumbnails/30dcc_2026_22.png"
format:
html:
toc: true
toc-depth: 5
code-link: true
code-fold: true
code-tools: true
code-summary: "Show code"
editor_options:
chunk_output_type: inline
execute:
freeze: true
cache: true
error: false
message: false
warning: false
eval: true
---
{#fig-1}
### [**Steps to Create this Graphic**]{.mark}
#### [1. Load Packages & Setup]{.smallcaps}
```{r}
#| label: load
#| warning: false
#| message: false
#| results: "hide"
## 1. LOAD PACKAGES & SETUP ----
suppressPackageStartupMessages({
pacman::p_load(
tidyverse, ggtext, showtext,
janitor, scales, glue
)
})
### |- figure size ----
camcorder::gg_record(
dir = here::here("temp_plots"),
device = "png",
width = 10,
height = 8,
units = "in",
dpi = 320
)
# Source utility functions
suppressMessages(source(here::here("R/utils/fonts.R")))
source(here::here("R/utils/social_icons.R"))
source(here::here("R/utils/image_utils.R"))
source(here::here("R/themes/base_theme.R"))
```
#### [2. Read in the Data]{.smallcaps}
```{r}
#| label: read
#| include: true
#| eval: true
#| warning: false
energy_raw <- read_csv(
here::here("data/30DayChartChallenge/2026/owid-energy-data.csv"),
show_col_types = FALSE
)
```
#### [3. Examine the Data]{.smallcaps}
```{r}
#| label: examine
#| include: true
#| eval: true
#| results: 'hide'
#| warning: false
glimpse(energy_raw)
```
#### [4. Tidy Data]{.smallcaps}
```{r}
#| label: tidy
#| warning: false
### |- define the 6 focal countries ----
focal_countries <- c(
"Norway", "Denmark", "China", "India", "Poland", "Australia"
)
### |- filter: focal countries, 2000–2023, non-missing renewable share ----
renewables_long <- energy_raw |>
filter(
country %in% focal_countries,
year >= 2000,
year <= 2023,
!is.na(renewables_share_elec)
) |>
select(country, year, renewables_share_elec) |>
mutate(
renewables_share_elec = round(renewables_share_elec, 1)
) |>
arrange(country, year)
## RESHAPE WIDE FOR DATAWRAPPER ----
# Datawrapper multi-line format:
# - One column per series (country)
# - One row per x-axis value (year)
# - First column = Year (x-axis)
#
# Shape:
# Year | Norway | Denmark | China | India | Poland | Australia
renewables_dw <- renewables_long |>
pivot_wider(
names_from = country,
values_from = renewables_share_elec
) |>
rename(Year = year) |>
# Column order: Year first, then countries roughly by 2023 share descending
select(Year, Norway, Denmark, Australia, China, India, Poland)
```
#### [5. Visualization Parameters]{.smallcaps}
```{r}
#| label: params
#| include: true
#| warning: false
## ---- DATAWRAPPER SETUP NOTES ------------------------------------------------
##
## 1. Upload CSV
## Dashboard > New Chart > Upload / paste CSV
## File: dcc_2026_day22_renewables_long.csv
##
## 2. Chart type
## Select: Lines (Multiple Lines if DW offers it)
## X-axis = Year (auto-detected as numeric/date)
## Each country column = one line
##
## 3. Refine tab — key settings
## - Line labels: "Right" — shows country name at end of each line
## - No legend needed if end-labels are on
## - Y-axis: start at 0, max ~100 (or let DW auto-scale)
## - X-axis: 2000 to 2023
## - Consider: bold Denmark line to draw the eye to the transition star
##
## 4. Annotate tab
## - Title: "Some countries surged. Others barely moved."
## or: "The uneven race to renewables"
## - Subtitle: "Renewable share of electricity, 2000–2023 (selected countries)"
## - Source: Our World in Data / Ember
## - Byline: Steven Ponce | #30DayChartChallenge 2026
## - Consider: one annotation callout on Denmark's acceleration ~2008–2020
##
## 5. Publish > Export PNG for thumbnail
## Save as: thumbnails/tt_30dcc_2026_22.png
##
## 6. Embed in .qmd
## Copy the responsive iframe code from Publish tab
## Paste inside a ```{=html} block in your Quarto file
```
#### [6. Plot]{.smallcaps}
```{r}
#| label: plot
#| warning: false
### |- main plot ----
# https://datawrapper.dwcdn.net/U969h/1/
## NOTE: Visualization handled entirely in Datawrapper (new tool).
## This script handles reshaping and CSV export only.
## Six countries chosen for maximum trajectory contrast:
## Norway — ceiling benchmark (~95% throughout)
## Denmark — dramatic rise, the transition star
## China — rising from a massive generation base
## India — modest rise, developing-world story
## Poland — low and slow, fossil fuel laggard
## Australia — late mover, strong recent acceleration
```
#### [7. Save]{.smallcaps}
```{r}
#| label: save
#| warning: false
### |- plot image ----
# save_plot(
# p,
# type = "30daychartchallenge",
# year = 2026,
# day = 22,
# width = 10,
# height = 8
# )
```
#### [8. Session Info]{.smallcaps}
::: {.callout-tip collapse="true"}
##### Expand for Session Info
```{r, echo = FALSE}
#| eval: true
#| warning: false
# sessionInfo()
```
:::
#### [9. GitHub Repository]{.smallcaps}
::: {.callout-tip collapse="true"}
##### Expand for GitHub Repo
The complete code for this analysis is available in [`30dcc_2026_22.qmd`](https://github.com/poncest/personal-website/blob/master/data_visualizations/TidyTuesday/2026/30dcc_2026_22.qmd).
For the full repository, [click here](https://github.com/poncest/personal-website/).
:::
#### [10. References]{.smallcaps}
::: {.callout-tip collapse="true"}
##### Expand for References
1. **Data Sources:**
- Hannah Ritchie, Pablo Rosado, and Max Roser (2023). Energy.
Published online at OurWorldInData.org.
Retrieved via Our World in Data GitHub repository.
Series: Renewable share of electricity (%), 2000–2023.
Countries: Norway, Denmark, Australia, China, Poland, India.
https://github.com/owid/energy-data
2. **Tool:**
- Datawrapper (2026). Free tier. Chart type: Line chart.
Visualization built and published at datawrapper.de.
https://datawrapper.dwcdn.net/U969h/1/
:::
#### [11. Custom Functions Documentation]{.smallcaps}
::: {.callout-note collapse="true"}
##### 📦 Custom Helper Functions
This analysis uses custom functions from my personal module library for efficiency and consistency across projects.
**Functions Used:**
- **`fonts.R`**: `setup_fonts()`, `get_font_families()` - Font management with showtext
- **`social_icons.R`**: `create_social_caption()` - Generates formatted social media captions
- **`image_utils.R`**: `save_plot()` - Consistent plot saving with naming conventions
- **`base_theme.R`**: `create_base_theme()`, `extend_weekly_theme()`, `get_theme_colors()` - Custom ggplot2 themes
**Why custom functions?**\
These utilities standardize theming, fonts, and output across all my data visualizations. The core analysis (data tidying and visualization logic) uses only standard tidyverse packages.
**Source Code:**\
View all custom functions → [GitHub: R/utils](https://github.com/poncest/personal-website/tree/master/R)
:::