A showcase of interactive chart types with CPAL styling
Introduction
This gallery showcases various interactive chart types using highcharter with CPAL styling. Each example demonstrates proper use of themes, color palettes, formatting, and logo placement.
Looking for Static Charts?
For static (non-interactive) visualizations using ggplot2, see the ggplot2 Chart Gallery.
Code Visibility
Click “Show code” above each chart to see the full implementation.
Basic Charts
Bar Chart (Horizontal)
When to use: Best for comparing values across categories, especially when category labels are long.
Show code
tx_counties |>arrange(desc(total_pop)) |>head(8) |>hchart("bar", hcaes(x = county, y = total_pop), name ="Population") |>hc_cpal_theme() |>hc_title(text ="Texas Counties by Population") |>hc_subtitle(text ="Top 8 counties, ACS 2023") |>hc_xAxis(title =list(text =NULL)) |>hc_yaxis_cpal(title ="Population", suffix ="M", divide_by =1000000) |>hc_tooltip_cpal(suffix =" residents") |>hc_add_cpal_logo()
Column Chart (Vertical)
When to use: Ideal for comparing values across a small number of categories (typically 3-8).
Show code
tx_counties |>head(6) |>hchart("column", hcaes(x = county, y = poverty_rate), name ="Poverty Rate") |>hc_cpal_theme() |>hc_title(text ="Poverty Rates by County") |>hc_subtitle(text ="Percentage of population below poverty line") |>hc_yAxis(title =list(text ="Poverty Rate"),labels =list(format ="{value}%"),max =30 ) |>hc_tooltip_cpal(decimals =1, suffix ="%") |>hc_add_cpal_logo()
Line Chart
When to use: Best for showing trends over time or continuous change across an ordered sequence.