axis: Axis

Description Usage Arguments Details Functions See Also Examples

Description

Customise axis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
e_axis(e, serie, axis = c("x", "y", "z"), index = 0,
  formatter = NULL, margin = 0, ...)

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

e_x_axis_(e, serie = NULL, index = 0, formatter = NULL, margin = 0,
  ...)

e_y_axis_(e, serie = NULL, index = 0, formatter = NULL, margin = 0,
  ...)

e_z_axis_(e, serie = NULL, index = 0, margin = 0, ...)

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

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

e_z_axis(e, serie, index = 0, margin = 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.

serie

Column name of serie to range the axis. If used the range of the serie is used as, min an max.

axis

Axis to customise.

index

Index of axis to customise.

formatter

An axis formatter as returned by e_axis_formatter.

margin

Margin to apply to serie: min = serie - margin and max = serie + margin

...

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.

Details

The e_axis_formatter may not work in RStudio, open the plot in your browser. It will display just fine in Rmarkdown and Shiny.

Functions

See Also

Additional x arguments, Additional y arguments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# range axis based on serie
cars %>% 
  e_charts(speed) %>% 
  e_line(dist) %>% 
  e_x_axis(speed) %>% 
  e_y_axis(dist)
  
# 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
  
  

JohnCoene/echarts4r documentation built on Sept. 18, 2019, 2:24 a.m.