Learn R Programming

echarts4r (version 0.1.1)

e_axis: Axis

Description

Customise axis.

Usage

e_axis(e, axis = c("x", "y", "z"), index = 0, ...)

e_x_axis(e, index = 0, ...)

e_y_axis(e, index = 0, ...)

e_z_axis(e, index = 0, ...)

Arguments

e

An echarts4r object as returned by e_charts.

axis

Axis to customise.

index

Index of axis to customise.

...

Any other option to pass, check See Also section.

See Also

https://ecomfe.github.io/echarts-doc/public/en/option.html#xAxis, https://ecomfe.github.io/echarts-doc/public/en/option.html#yAxis

Examples

Run this code
# NOT RUN {
USArrests %>% 
  e_charts(Assault) %>% 
  e_line(Murder, smooth = TRUE) %>% 
  e_line(Rape, y.index = 1) %>% # add secondary axis
  e_y_axis(index = 1, show = FALSE) # hide secondary axis

# plot all labels & rotate
USArrests %>% 
  head(10) %>% 
  dplyr::mutate(State = row.names(.)) %>% 
  e_charts(State) %>% 
  e_area(Murder) %>% 
  e_x_axis(axisLabel = list(interval = 0, rotate = 45)) # rotate
  
# }

Run the code above in your browser using DataLab