# scaling
e_scale(c(1, 1000))
mtcars |>
e_charts(mpg) |>
e_scatter(wt, qsec)
# custom function
my_scale <- function(x) scales::rescale(x, to = c(2, 50))
echart <- mtcars |>
e_charts(mpg) |>
e_scatter(wt, qsec, scale = my_scale)
echart
# rescale color too
echart |>
e_visual_map(wt, scale = my_scale)
# or
echart |>
e_visual_map(min = 2, max = 50)
# disable scaling
mtcars |>
e_charts(qsec) |>
e_scatter(wt, mpg, scale = NULL)
# jitter point
mtcars |>
e_charts(cyl) |>
e_scatter(wt, symbol_size = 5) |>
e_scatter(wt, jitter_factor = 2, legend = FALSE)
# examples
USArrests |>
e_charts(Assault) |>
e_scatter(Murder, Rape) |>
e_effect_scatter(Rape, Murder, y_index = 1) |>
e_grid(index = c(0, 1)) |>
e_tooltip()
iris |>
e_charts_("Sepal.Length") |>
e_scatter_(
"Sepal.Width",
symbol_size = c(8, 2),
symbol = "rect"
) |>
e_x_axis(min = 4)
quakes |>
e_charts(long) |>
e_geo(
roam = TRUE,
boundingCoords = list(
c(185, -10),
c(165, -40)
)
) |>
e_scatter(lat, mag, coord_system = "geo") |>
e_visual_map(min = 4, max = 6.5)
# timeline
iris |>
group_by(Species) |>
e_charts(Petal.Width, timeline = TRUE) |>
e_scatter(Sepal.Width, Sepal.Length) |>
e_tooltip(trigger = "axis")
Run the code above in your browser using DataLab