hgch_pie | R Documentation |
This function generates a Highcharts pie chart based on the given data.
hgch_pie(data, dic = NULL, var_cat = NULL, var_num = NULL, ...)
data |
A data frame containing the data to be plotted. |
dic |
A named list of character vectors that replaces column names in data. The names of the list should match column names in data, and each vector should contain the replacement names. |
var_cat |
A character vector of categorical variable(s) to use in the chart. |
var_num |
A character vector of numeric variable(s) to use in the chart. |
... |
Additional arguments to be passed to |
A Highcharts pie chart object.
data_draw
data1 <- data.frame(name = c("A", "B", "C"), y = c(10, 20, 30))
hgch_pie(data1,
var_cat = "name",
var_num = "y")
# Custom theme
test_theme <- list(
theme = list(
palette_colors = c("#ffa92a", "black", "lightgreen"),
subtitle_align = "center",
subtitle_family = "Roboto",
subtitle_size = 15,
subtitle_color = "#3b83b8",
subtitle_weight = 700
)
)
hgch_pie(data1,
var_cat = "name",
var_num = "y",
opts = test_theme,
subtitle = "test subtitle",
title = "test title")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.