# set color palette
cols <- brewer.pal(7, "Set2")
# stacked area chart
highchart () |>
hc_add_series(data = regions,
type = "area",
hcaes(x = year,
y = gdp_tn,
group = region)) |>
hc_colors(cols) |>
hc_chart(style = list(fontFamily = "Georgia",
fontWeight = "bold")) |>
hc_plotOptions(series = list(stacking = "normal",
marker = list(enabled = FALSE,
states = list(hover = list(enabled = FALSE))),
lineWidth = 0.5,
lineColor = "white")) |>
hc_xAxis(title = list(text="Year")) |>
hc_yAxis(title = list(text="GDP ($ trillion)")) |>
hc_legend(align = "right", verticalAlign = "top",
layout = "vertical")