// for. If it is, just use it, otherwise search the array for a point
// in the proper place.
var setRow = row - this.getLeftBoundary_(setIdx);
- if (setRow < points.length && points[setRow].idx == row) {
+ if (setRow >= 0 && setRow < points.length && points[setRow].idx == row) {
var point = points[setRow];
if (point.yval !== null) this.selPoints_.push(point);
} else {
this.setIndexByName_ = {};
var labels = this.attr_("labels");
- if (labels.length > 0) {
- this.setIndexByName_[labels[0]] = 0;
- }
var dataIdx = 0;
for (var i = 1; i < points.length; i++) {
- this.setIndexByName_[labels[i]] = i;
if (!this.visibility()[i - 1]) continue;
this.layout_.addDataset(labels[i], points[i]);
this.datasetIndex_[i] = dataIdx++;
}
+ for (var i = 0; i < labels.length; i++) {
+ this.setIndexByName_[labels[i]] = i;
+ }
this.computeYAxisRanges_(extremes);
this.layout_.setYAxes(this.axes_);