bar_line_echart: Bar and Line Chart (with Timeline)

Description Usage Arguments Value

Description

Plot bar and line chart using e_bar and e_line. Regardless of whether there is a timeline axis, this function can plot charts correctly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
bar_line_echart(
  data,
  timeline_var = NULL,
  x_var,
  bar_var,
  line_var,
  main_axis_name,
  sec_axis_name,
  x_axis_name,
  axis_fontsize = 12,
  x_name_gap = 25,
  long_x_label = FALSE,
  x_label_width = 30,
  use_y_upper_bound = FALSE,
  show_label = TRUE,
  toolbox_features = c("saveAsImage", "restore", "dataView")
)

Arguments

data

a data frame

timeline_var

character. The variable indicating timeline.

x_var

character. The variable that will be the X axis in the chart.

bar_var

character vector. The variable that will be used to draw bar chart.

line_var

character vector. The variable that will be used to draw line chart.

main_axis_name

character. The name of main Y axis. If missing, the function will use information in option to auto-detect the name according to bar_var.

sec_axis_name

character. The name of secondary Y axis. If missing, the function will use information in option to auto-detect the name according to line_var.

x_axis_name

character. The name of X axis. If missing, the function will use information in option to auto-detect the name according to x_var.

axis_fontsize

numeric, default 12. The font size of axis name.

x_name_gap

numeric, default 25. The distance between x axis and label of x axis.

long_x_label

logical, default FALSE. Whether to use style that solving the problem than the label text of x axis is too long.

x_label_width

numeric, default 30. The label text width of x axis.

use_y_upper_bound

logical, default FALSE. Whether to use upper bound of Y axis.

show_label

logical, default TRUE. Whether to show data labels.

toolbox_features

character vectors, default c('saveAsImage', 'restore', 'dataView'). It controls the toolbox functions in echarts.

Value

an object of class echarts4r.


YuanchenZhu2020/antgreens documentation built on Dec. 18, 2021, 8:20 p.m.