If the points array is missing points, for instance because the data
handler omitted them, setSelection() will now still properly find
the points that are being selected by looking at the points' idx
property instead of just indexing into the points array.
};
/**
- * Converts a series to a Point array.
+ * Converts a series to a Point array. The resulting point array must be
+ * returned in increasing order of idx property.
*
* @param {!Array.<[!number,?number,?]>} series The series in the unified
* data format where series[i] = [x,y,{extras}].
this.lastRow_ = row;
for (var setIdx = 0; setIdx < this.layout_.points.length; ++setIdx) {
var points = this.layout_.points[setIdx];
- var setRow = row - this.getLeftBoundary_(setIdx);
- if (setRow < points.length) {
- var point = points[setRow];
- if (point.yval !== null) this.selPoints_.push(point);
+ for (var pointIdx = 0; pointIdx < points.length; ++pointIdx) {
+ var point = points[pointIdx];
+ if (point.idx == row) {
+ if (point.yval !== null) {
+ this.selPoints_.push(point);
+ }
+ break;
+ }
}
}
} else {