Add waterfall style bars to the column chart
add_waterfall_bars(
svg_string,
df,
x,
series,
bar_width,
styles = NULL,
pos_color = "rgb(64,64,64)",
neg_color = "black",
add_result_bar = TRUE,
result_bar_pos = "1",
positive_prefix = "",
result_bar_color = NULL,
result_title = NULL,
ref_value = 0,
translate_vec = c(0, 0)
)
the svg string to br appended, need to be finalized after
data to be plotted - data frame in wide format
vector to be on x axis
character vector of column names representing series to split bars by it
the width of plotted bar
vector of styles of the bars
color to be associated with positive values (in string format)
color to be associated with negative values (in string format)
boolean flag to add result bar as the last bar or not.
flag indicating position of the result bar. 1 - bar offset 1/9 category width right from the last bar. 2 - result bar as completely new bar. If add_result_bar is false, it is ignored.
how to indicate positive value, ie. "+" or ""(empty string).
color of result bar. If add_result_bar is false, it is ignored.
title of result bar to be on x axis. If add_result_bar is false, it is ignored.
first bar starts from this value, intended to be used with add_first_bar function.
2 element translation vector. By setting this parameter you can translate bars and legend.
svg string with appended waterfall bars