Description Usage Arguments Value Author(s) See Also Examples
View source: R/dumbbell_chart.R
Easily create a dumbbell chart
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
data |
Dataset to use for the dumbbell chart |
x |
|
y1 |
|
y2 |
|
line_size |
|
line_color |
|
point_size |
|
point_colors |
|
sort |
|
horizontal |
|
top_n |
|
legend |
|
legend_labels |
|
limit |
Deprecated. use |
An object of class ggplot
Thomas Neitmann
To learn how to further customize this plot have a look at the 'customize' vignette:
vignette("customize", package = "ggcharts")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(popeurope)
dumbbell_chart(popeurope, country, pop1952, pop2007)
# Display only the top 10 countries in terms of population in 2007
dumbbell_chart(popeurope, country, pop1952, pop2007, top_n = 10)
# Change line and point color
dumbbell_chart(popeurope, country, pop1952, pop2007, top_n = 10,
line_color = "lightgray", point_color = c("lightgray", "black"))
# Add custom legend labels
dumbbell_chart(popeurope, country, pop1952, pop2007, top_n = 10,
legend_labels = c("1952", "2007"))
# Increase line width and point size
dumbbell_chart(popeurope, country, pop1952, pop2007, top_n = 10,
line_size = 2, point_size = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.