There are a number of new features brought by version 5 of echarts.js, not all are showcased here, see the official changelog for more information.
Dark mode
Darkmode helps when using dark backgrounds, it’ll automatically re-color labels, grid lines, legend text, etc.
Aria Decal
Decal provides a new visual type that does not only augment aria scenarios but also enrich visual effects.
Datazoom Enhancements
Visual improvements to the datazoom feature.
e_charts(mtcars, qsec) |>
e_scatter(mpg, wt) |>
e_datazoom(startValue = 14)
Labels
Many improvements to labels were added.
mtcars |>
tibble::rownames_to_column("model") |>
e_charts(model) |>
e_bar(
mpg,
label = list(
formatter = '{c} {name|{a}}',
show = TRUE,
rotate = 90,
align = "left",
verticalAlign = "middle",
position = "insideBottom",
rich = list(name = list())
)
)
There are also new options such as labelLine
and
labelLayout
.
SVG Map
url <- "https://echarts.apache.org/examples/data/asset/geo/Beef_cuts_France.svg"
svg <- url |>
readLines() |>
paste0(collapse = "")
## Warning in readLines(url): incomplete final line found on
## 'https://echarts.apache.org/examples/data/asset/geo/Beef_cuts_France.svg'
data <- tibble::tibble(
name = c(
"Queue",
"Langue",
"Plat de joue",
"Collier",
"Rumsteck",
"Plat de joue",
"Onglet",
"Plat de tranche",
"Araignée",
"Gîte à la noix",
"Bavette d'aloyau",
"Tende de tranche",
"Rond de gîte",
"Plat de côtes",
"Bavette",
"Basses côtes",
"Jumeau à biftek",
"Jumeau à pot-au-feu",
"Paleron",
"Macreuse à bifteck",
"Macreuse à pot-au-feu",
"Tendron Milieu de poitrine",
"Flanchet",
"Bavettede de flanchet",
"Hampe",
"Filet",
"Aiguillette baronne",
"Côtes Entrecôtes",
"Faux-filet",
"Gîte",
"Gros bout de poitrine"
),
value = runif(31, 10, 15)
)
data |>
e_charts(name) |>
e_svg_register("beef", svg) |>
e_svg(
value,
map = "beef",
label = list(
show = FALSE
)
) |>
e_visual_map(
value,
orient = "horizontal"
)