var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
};
+
+// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=201
+CustomBarsTestCase.prototype.testCustomBarsZero = function() {
+ var opts = {
+ customBars: true
+ };
+ var data = "X,Y1,Y2\n" +
+"1,1;2;3,0;0;0\n" +
+"2,2;3;4,0;0;0\n" +
+"3,1;3;5,0;0;0\n";
+
+ var graph = document.getElementById("graph");
+ var g = new Dygraph(graph, data, opts);
+
+ var range = g.yAxisRange();
+ assertTrue('y-axis must include 0', range[0] <= 0);
+ assertTrue('y-axis must include 5', range[1] >= 5);
+};
// With custom bars, maxY is the max of the high values.
for (j = 0; j < series.length; j++) {
y = series[j][1][0];
- if (!y) continue;
+ if (y === null || isNaN(y)) continue;
var low = y - series[j][1][1];
var high = y + series[j][1][2];
if (low > y) low = y; // this can happen with custom bars,
}
this.computeYAxisRanges_(extremes);
+ console.log(extremes);
this.layout_.setYAxes(this.axes_);
this.addXTicks_();