shutterstock/rickshaw — pull request #22 by smithclay (2012-02-04 01:05:17+00:00)
Title: Toggling RangeSlider so xMin = xMax causes javascript errors

When viewing a graph with a RangeSlider, it's possible to move the sliders such that xMin = xMax (i.e. overlapping min/max buttons on the slider). This causes some javascript errors.

In particular, this code in Rickshaw.Graph:

```javascript
var data = this.series.active()
.map( function(d) { return d.data } )
.map( function(d) { return d.filter( function(d) { return this._slice(d) }, this ) }, this);
```

results in data[0].length === 0, which causes this code in Rickshaw.Graph.Renderer.Bar:

```javascript
var xMin = stackedData[0][0].x;
var xMax = stackedData[0][ stackedData[0].length - 1 ].x;
```

to blow up since stackedData[0][0].x is undefined.

The commit ensures that stackedData[0][0] always exists. However, I have a feeling there's a better solution out there... while these commits seem to fix the javascript errors, Chrome 16 still reports this error in the console: Error: Invalid value for rect attribute height="NaN"