highchart() %>%
hc_chart(type = "area") %>%
hc_title(text = "Volatility Contribution") %>%
hc_plotOptions(area = list(
stacking = "percent",
lineColor = "#ffffff",
lineWidth = 1,
marker = list(
lineWidth = 1,
lineColor = "#ffffff"
))
) %>%
hc_add_series(portfolio_vol_components_tidy_xts[, 1],
name = symbols[1]) %>%
hc_add_series(portfolio_vol_components_tidy_xts[, 2],
name = symbols[2]) %>%
hc_add_series(portfolio_vol_components_tidy_xts[, 3],
name = symbols[3]) %>%
hc_add_series(portfolio_vol_components_tidy_xts[, 4],
name = symbols[4]) %>%
hc_add_series(portfolio_vol_components_tidy_xts[, 5],
name = symbols[5]) %>%
hc_yAxis(labels = list(format = "{value}%"),
opposite = FALSE) %>%
hc_xAxis(type = "datetime") %>%
hc_tooltip(pointFormat = "<span style=\"color:{series.color}\">
{series.name}</span>:<b>{point.percentage:.1f}%</b><br/>",
shared = TRUE) %>%
hc_navigator(enabled = FALSE) %>%
hc_scrollbar(enabled = FALSE) %>%
hc_add_theme(hc_theme_flat()) %>%
hc_exporting(enabled = TRUE) %>%
hc_legend(enabled = TRUE)