Skip to contents

`xl_chart_error_bars()` draws an error bar at each point, and is given to [xl_chart_series()] as `x_error_bars` or `y_error_bars`.

Usage

xl_chart_error_bars(
  type,
  value = NA,
  direction = NULL,
  endcap = NA,
  format = NULL
)

Arguments

type

How the size of each bar is worked out: `"std_error"` for the standard error, `"fixed"` for a constant, `"percentage"` of the point's own value, or `"std_dev"` for that many standard deviations.

value

The constant, the percentage, or the number of standard deviations. `"std_error"` needs none.

direction

`"both"`, `"plus"` or `"minus"`.

endcap

Draw the cap at the end of each bar. On by default.

format

An [xl_format()] styling the bars — [xl_border()] only, since an error bar is a line.

Value

An `xl_chart_error_bars` object.

Examples

xl_chart_error_bars("percentage", 5)
#> <xl_chart_error_bars>
#>   set: type, value 
xl_chart_error_bars("std_dev", 1, direction = "plus", endcap = FALSE)
#> <xl_chart_error_bars>
#>   set: type, value, direction, endcap