Skip to contents

Size scale for continuous data

Usage

v_scale_size(
  vc,
  name = NULL,
  range = c(5, 30),
  ...,
  position = c("right", "bottom", "left", "top"),
  align = c("middle", "start", "end")
)

Arguments

vc

An htmlwidget created with vchart() or specific chart's type function.

name

Title for the legend.

range

Range of sizes for the points plotted.

...

Additional parameters for the legend.

position

Position of the legend.

align

Alignment of the legend.

Value

A vchart() htmlwidget object.

Examples

library(vchartr)
data("penguins", package = "palmerpenguins")

vchart(penguins) %>%
  v_scatter(aes(
    x = bill_length_mm, 
    y = bill_depth_mm,
    size = body_mass_g
  )) %>% 
  v_scale_size(
    name = "Body mass",
    range = c(1, 20)
  )