knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

The following 77 icons are included.

Scatter

Simply use the ea_icons to which you pass the name of the icon you want.

library(echarts4r)
library(echarts4r.assets)

mtcars %>% 
  e_charts(mpg) %>% 
  e_scatter(
    wt, 
    qsec,
    symbol = ea_icons("trash"),
    name = "Trash"
  ) %>% 
  e_legend(icons = ea_icons("trash"))

Legend

You can pass multiple names to ea_icons.

# laod icon data
data("icons") 

# select 3 random icons (1 / group)
icon_names <- sample(icons$name, 3) 

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_scatter(Sepal.Width, Petal.Length) %>% 
  e_legend(
    icon = ea_icons(icon_names)
  )

Pictorial

Works with anything that takes a symbol.

y <- rnorm(10, 10, 2)
df <- data.frame(
  x = 1:10,
  y = y,
  z = y - rnorm(10, 5, 1)
)

df %>% 
  e_charts(x) %>% 
  e_pictorial(
    y, 
    name = "volume",
    symbol = ea_icons("microphone"), 
    symbolRepeat = TRUE, 
    z = -1,
    symbolSize = c(20, 30)
  ) %>% 
  e_theme("dark")

Search

You can search icons with the convenience function e_icon_search.

ea_icons_search("no")

Custom

Look at the output of ea_icons to understand how to pass your own SVG paths.

cat(
  ea_icons("volume")
)

All icons

All 77 icons.

icons$name


JohnCoene/echarts4r.assets documentation built on Aug. 30, 2019, 11:40 a.m.