Skip to main content

Bar Chart

Bar chart.

Options#

  • data | object (required): object of value arrays. Default: none.
  • variable | (string|Factor) (required): variable to display. Default: none.
  • group | (string|Factor): grouping variable. Default: none.
  • yvar | string: optional variable used for the column heights (in conjunction with summary). Default: none.
  • summary | string: name of statistic to compute for yvar and to be displayed as bar height for each category (either Min, Max, Mean, Median, Sum, ...). Default: none.
  • horizontal | boolean: whether to display bars horizontally. Default: false.
  • stackBars | boolean: when grouping, controls whether to stack bars on top of each other. Default: false.
  • relative | boolean: whether to calculate relative frequencies inside each group. Default: false.
  • totalPercent | boolean: whether to display overall bars as relative frequencies. Default: false.
  • xOrder | string: either total, category, min, max, mean, or median. Default: none.
  • direction | string: how to order bars alongside x-axis (ascending or descending). Default: 'ascending'.

Examples#

Live Editor
Result
Last updated on by Planeshifter