# Class: c3.Plot.Layer.Bar

Defined in: | js/c3-layers.coffee
Inherits: | c3.Plot.Layer.Stackable

## Overview

TODO: Support negative y values for bar layers

Bar chart layer for the XY Plot Chart

Bar charts may have positive or negative values unless they are stacked, then they must be positive.

When an orinal scale is used this layer will adjust it so that it provides padding so the full bar on the left and right ends are fully visible. With other types of scales the bars may have arbitrary x values from the user and may overlap. In this case, it is up to the user to set the domain so bars are fully visible.

## Extensibility

The following c3.Selection members are made available if appropriate:

- rects

### Author:

- Douglas Armstrong

## Variables Summary

version =

      0.2

type =

      'bar'

key =

      undefined

  [Function] A callback to describe a unique key for each data element. This is useful for animations during a redraw when updating the dataset.

bar_width =

      "50%"

  [Number, String, Function] Specify the width of the bars. If this is a number it specifies the bar width in pixels. If this is a string, such as `50%`, then it can specify the width of the bars as a percentage of the available space for each bar based on proximity to each neighbor. If this is a function it can set the width dynamically for each bar.

rect_options =

      undefined

  [c3.Selection.Options] Options for the svg:rect's. The callbacks are called with the user data for the rect as the first argument, the index of that datum as the second argument, and the index of the stack for this rect as the third argument. `stack.options` can be used instead to apply the same options to an entire stack.

### Variable inherited from c3.Plot.Layer.Stackable

version type stack_options stacks safe _next_uid data name class static_data h v x y options handlers restyle

## Instance Method Summary

- # (void) _update() Bound
- # (void) _draw(origin) Bound
- # (void) _style(style_new) Bound

## Inherited Method Summary

### Methods inherited from c3.Plot.Layer.Stackable

#_stack #_update #_style #min_x #max_x #min_y #max_y #init #size #update #draw #style #zoom #redraw #scale

## Instance Method Details

# (void) _update() Bound

# (void) _draw(origin) Bound

# (void) _style(style_new) Bound

Quickly fuzzy find classes, mixins, methods, file:

- T Open fuzzy finder dialog

Control the navigation frame:

- L Toggle list view
- C Show class list
- I Show mixin list
- F Show file list
- M Show method list
- E Show extras list

You can focus and blur the search input:

- S Focus search input
- Esc Blur search input