-
-/**
- * Behaves the same way as PlotKit.Layout, but also copies the errors
- * @private
- */
-DygraphLayout.prototype.evaluateWithError = function() {
- this.evaluate();
- if (!(this.attr_('errorBars') || this.attr_('customBars'))) return;
-
- // Copy over the error terms
- var i = 0; // index in this.points
- for (var setName in this.datasets) {
- if (!this.datasets.hasOwnProperty(setName)) continue;
- var j = 0;
- var dataset = this.datasets[setName];
- var axis = this.dygraph_.axisPropertiesForSeries(setName);
- for (var j = 0; j < dataset.length; j++, i++) {
- var item = dataset[j];
- var xv = parseFloat(item[0]);
- var yv = parseFloat(item[1]);
-
- if (xv == this.points[i].xval &&
- yv == this.points[i].yval) {
- var errorMinus = parseFloat(item[2]);
- var errorPlus = parseFloat(item[3]);
-
- var yv_minus = yv - errorMinus;
- var yv_plus = yv + errorPlus;
- this.points[i].y_top = DygraphLayout._calcYNormal(axis, yv_minus);
- this.points[i].y_bottom = DygraphLayout._calcYNormal(axis, yv_plus);
- }
- }
- }
-};
-