Customise axis.

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

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

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

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

e_rm_axis(e, axis = c("x", "y", "z"))

e_axis_formatter(style = c("decimal", "percent", "currency"),
  digits = 0, locale = NULL, currency = "USD")

Arguments

e

An echarts4r object as returned by e_charts.

axis

Axis to customise.

index

Index of axis to customise.

formatter

An axis formatter as returned by e_axis_formatter.

...

Any other option to pass, check See Also section.

style

Formatter style, one of decimal, percent, or currency.

digits

Number of decimals.

locale

Locale, if NULL then it is inferred from Sys.getlocale.

currency

Currency to to display.

Functions

  • e_axis to customise axis

  • e_rm_axis to remove axis

See also

Examples

# hide axis 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 # use formatter cars %>% dplyr::mutate( speed = speed / 25 ) %>% e_charts(speed) %>% e_scatter(dist) %>% e_y_axis( formatter = e_axis_formatter("currency") ) %>% e_x_axis( formatter = e_axis_formatter("percent", digits = 0) ) # 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