Creates a waterfall plot showing sources of variance as rectangular segments connected by dotted lines
1 2 3 4 |
.data |
The data frame or tibble containing your data |
labels |
The column name that you want to use to label the x-axis |
values |
The column name that you want to include in the plot |
incremental |
Set to TRUE if the series contains incremental values to plot. Set to FALSE if the series contains actual values and incremental values must be calculated. Default is TRUE. |
anchors |
(optional) A column name, logical vector, or numeric vector indicating which segments should touch the x-axis. |
anchor.final |
Whether to anchor the last bar in the waterfall. Default is TRUE. |
width |
Bar width in units, where 1 means the edges of the bars touch. Default = 0.8. |
fill.values |
Fill colors to use on waterfall, in order of 'pos', 'neg', 'anchor'. Default is ‘c(’green', 'red', 'navy')'. |
segment.label |
Show numerical values as text for each non-anchor column? Default is 'TRUE'. |
anchor.label |
Show numerical values as text for each anchor column? Default is 'TRUE'. |
text.format |
Format to use to display text values as a text string. Uses ‘sprintf()'. Default is ’%.1f', which rounds the number to one decimal place. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.