add_bars {tidycharts} | R Documentation |
add bars to svg string
Description
add bars to svg string
Usage
add_bars(
svg_string,
df,
x,
series,
bar_width,
styles = NULL,
x_offset = 0,
translate = c(0, 0),
add_x_axis = TRUE,
color = NULL,
add_legend = FALSE,
legend_position = "left_top",
max_val = NULL
)
Arguments
svg_string |
the svg string to br appended, need to be finalized after |
df |
data to be plotted - data frame in wide format |
x |
vector to be on x axis |
series |
character vector of column names representing series to split bars by it |
bar_width |
the width of plotted bar |
styles |
vector of styles of the bars |
x_offset |
how much bars should be offset to the right (negative value means offsetting to the left) |
translate |
vector of translation of the bars from the origin |
add_x_axis |
boolean flag, if true automatically adds x axis with label |
color |
optional custom color of the bars series, in svg string format, ie.: "rgb(223,12,121)" or "black" |
add_legend |
boolean flag if legend should be added |
legend_position |
string with legend position |
max_val |
maximal value that bars will be scaled to |
Value
svg string with added bars
[Package tidycharts version 0.1.3 Index]