elasticsearch/kibana — pull request #1659 by stormpython (2014-10-13 22:44:45+00:00)
Title: Vislib: Percentage Bar Charts and Grouped Bar Charts 

Adds the ability to create percentage bar charts and grouped bar charts. These changes work for both time series and nominal (d3 ordinal) scales. See photos below.

![screen shot 2014-10-14 at 1 29 20 am](https://cloud.githubusercontent.com/assets/3149785/4621223/70e2a7da-5328-11e4-9820-44de0ce83861.png)
![screen shot 2014-10-13 at 9 45 52 pm](https://cloud.githubusercontent.com/assets/3149785/4621224/7339b262-5328-11e4-9b5f-ca4187286670.png)

To use them, you'll need to specify an `offset` string in the parameters passed into the `Vis` constructor.
There are 3 options available:

1. zero (default) - stacked bars
2. expand - percentage bars
3. group - grouped bars

For example:

```javascript
var params = {

type: 'vertical-bar',
offset: 'expand'
};

var myVis = new Vis($el, params);
```

**NOTE**: There are still issues that need discussing before the pull request can be merged.

The first is regarding event data returned on by an event listener. Currently, it passes back the percentage value with the percentage bar charts, but in many cases, we will need both the percentage values and the original doc count, avg, min, max, etc. The second issue is regarding buckets being cutoff on the left and right side of the charts, particularly on grouped bar charts. Some values in the group will appear while others will not.