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

e_common(
    font_family = "Raleway"
)

With echarts4r comes a small but powerful low level API to graphic elements.

Functions

Graphic functions end in _g

Draft

The e_draft helper function is a very simple wrapper aroudn the graphics API and thus a good example of what can be achieved.

cars |> 
  e_charts(speed) |> 
  e_scatter(dist) |>
  e_draft()

Image

You can add an image for instance.

cars |> 
  e_charts(speed) |> 
  e_scatter(dist) |>
  e_image_g(
    right = 20,
    top = 20,
    z = -999,
    style = list(
      image = "https://www.r-project.org/logo/Rlogo.png",
      width = 150,
      height = 150,
      opacity = .6
    )
  )


JohnCoene/echarts4 documentation built on Feb. 23, 2024, 9:18 a.m.