Learn R Programming

echarts4r (version 0.1.1)

e_scatter: Scatter

Description

Add scatter serie.

Usage

e_scatter(e, serie, size, bind, scale = "* 1", name = NULL,
  coord.system = "cartesian2d", legend = TRUE, y.index = 0,
  x.index = 0, rm.x = TRUE, rm.y = TRUE, ...)

e_effect_scatter(e, serie, size, bind, scale = "* 1", name = NULL, coord.system = "cartesian2d", legend = TRUE, y.index = 0, x.index = 0, rm.x = TRUE, rm.y = TRUE, ...)

e_scatter_(e, serie, size = NULL, bind = NULL, scale = "* 1", name = NULL, coord.system = "cartesian2d", legend = TRUE, y.index = 0, x.index = 0, rm.x = TRUE, rm.y = TRUE, ...)

e_effect_scatter_(e, serie, size = NULL, bind = NULL, scale = "* 1", name = NULL, coord.system = "cartesian2d", legend = TRUE, y.index = 0, x.index = 0, rm.x = TRUE, rm.y = TRUE, ...)

Arguments

e

An echarts4r object as returned by e_charts.

serie

Column name of serie to plot.

size

Column name containing size of points.

bind

Binding between datasets, namely for use of e_brush.

scale

Scale for size, defaults to * 1 which multiplies the size by 1 (equivalent to no multiplier).

name

name of the serie.

coord.system

Coordinate system to plot against.

legend

Whether to add serie to legend.

y.index

Indexes of x and y axis.

x.index

Indexes of x and y axis.

rm.x, rm.y

Whether to remove x and y axis, only applies if coord.system is not set to cartesian2d.

...

Any other option to pass, check See Also section.

See Also

https://ecomfe.github.io/echarts-doc/public/en/option.html#series-scatter, https://ecomfe.github.io/echarts-doc/public/en/option.html#series-effectScatter

Examples

Run this code
# NOT RUN {
USArrests %>% 
  e_charts(Assault) %>% 
  e_scatter(Murder, Rape) %>% 
  e_effect_scatter(Rape, Murder, y.index = 1) %>% 
  e_grid(index = c(0, 1)) %>% 
  e_tooltip()

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)
  
# Calendar
year <- seq.Date(as.Date("2017-01-01"), as.Date("2017-12-31"), by = "day")
values <- rnorm(length(year), 20, 6)

year <- data.frame(year = year, values = values)

year %>% 
  e_charts(year) %>% 
  e_calendar(range = "2018") %>% 
  e_scatter(values, coord.system = "calendar") %>% 
  e_visual_map(max = 30)
  
# }

Run the code above in your browser using DataLab