There are a number of new features brought by version 6 of echarts.js, not all are showcased here, see the official changelog for more information.
New default theme
The default theme has been updated with a new color palette that is more consistent between chart types and components. The old theme can still be used by referring to “v5”.
New chart features
Scatter charts now support support an attribute called jitter. Jitter
helps prevent overlap of data points to make the distribution of points
easier to see. You can access this feature with
e_jitter
df <- data.frame(
value = c(rnorm(50, mean = 5, sd = 1),
rnorm(50, mean = 10, sd = 1)),
group = rep(c("Group A", "Group B"), each = 50)
)
df |>
e_charts(group) |>
e_scatter(value, legend = FALSE) |>
e_jitter(jitter = 30, jitterOverlap = FALSE)Bar charts now support a new axis break effect referred to as
zigzags. This helps to show data where there are large differences in
elements. You can click the break to expand to the original data ratio.
This can be accessed with e_zigzag
Matrix coordinate system
One of the largest updates for Echarts v6 is the development of the new matrix coordinate system. This function in a similar method as the previous grid system. The matrix system allows you to build out charts using a table style layout in which you can combine various charts into one final product.
Using this new layout system, users can combine various chart types and components to create even more complex visuals. See Matrix for additional details.
New chart types
There are 7 new chart types: e_doughnut,
e_violin, e_barRange, e_contour,
e_lineRange, e_stage, and
e_chord. See Chart
Types for more information on usage.
Annotations
Annotations can also be added to a chart. See Annotations for more information on usage.
mtcars |>
e_charts(mpg) |>
e_scatter(wt) |>
e_annotations(
annotations = list(
list(
id = 0,
x = 16,
y = 3.1,
offsetY = 40,
offsetX = -40,
text = 'An annotation!'
)
)
)