var first_point = true;
var addPoint = function(ctx_, point) {
if (point.name == setName) {
- if (isNaN(point.canvasy)) {
+ if (!point.canvasy || isNaN(point.canvasy)) {
// this will make us move to the next point, not draw a line to it.
first_point = true;
} else {
ctx.clearRect(px - circleSize - 1, 0, 2 * circleSize + 2, this.height_);
}
+ var isOK = function(x) { return x && !isNaN(x); };
+
if (selPoints.length > 0) {
var canvasx = selPoints[0].canvasx;
var replace = this.attr_('xValueFormatter')(lastx, this) + ":";
var clen = this.colors_.length;
for (var i = 0; i < selPoints.length; i++) {
- if (isNaN(selPoints[i].canvasy)) continue;
+ if (!isOK(selPoints[i].canvasy)) continue;
if (this.attr_("labelsSeparateLines")) {
replace += "<br/>";
}
// Draw colored circles over the center of each selected point
ctx.save()
for (var i = 0; i < selPoints.length; i++) {
- if (isNaN(selPoints[i%clen].canvasy)) continue;
+ if (!isOK(selPoints[i%clen].canvasy)) continue;
ctx.beginPath();
ctx.fillStyle = this.colors_[i%clen].toRGBString();
ctx.arc(canvasx, selPoints[i%clen].canvasy, circleSize, 0, 360, false);
if (series[k][0] >= low && series[k][0] <= high) {
pruned.push(series[k]);
var y = bars ? series[k][1][0] : series[k][1];
+ if (!y) continue;
if (maxY == null || y > maxY) maxY = y;
if (minY == null || y < minY) minY = y;
}
if (!this.customBars_) {
for (var j = 0; j < series.length; j++) {
var y = bars ? series[j][1][0] : series[j][1];
+ if (!y) continue;
if (maxY == null || y > maxY) {
maxY = bars ? y + series[j][1][1] : y;
}
1.0 * (high - mid) / count ]];
}
} else {
+ if (rollPeriod == 1) {
+ return originalData;
+ }
+
// Calculate the rolling average for the first rollPeriod - 1 points where
// there is not enough data to roll over the full number of days
var num_init_points = Math.min(rollPeriod - 1, originalData.length - 2);
<![endif]-->
<script type="text/javascript" src="../dygraph-combined.js"></script>
<script type="text/javascript" src="../dygraph-canvas.js"></script>
+ <script type="text/javascript" src="../plotkit_v091/PlotKit/Layout.js"></script>
<script type="text/javascript" src="../dygraph.js"></script>
</head>
<body>
<div id="graph"></div>
+ <div id="graph2"></div>
+ <div id="graph3"></div>
+
<script type="text/javascript">
new Dygraph(
document.getElementById("graph"),
"2009/12/06,18,15\n" +
"2009/12/07,12,16\n"
);
+
+ new Dygraph(
+ document.getElementById("graph2"),
+ [
+ [ new Date("2009/12/01"), 10, 10],
+ [ new Date("2009/12/02"), 15, 11],
+ [ new Date("2009/12/03"), null, 12],
+ [ new Date("2009/12/04"), 20, 13],
+ [ new Date("2009/12/05"), 15, null],
+ [ new Date("2009/12/06"), 18, 15],
+ [ new Date("2009/12/07"), 12, 16]
+ ],
+ { labels: ["Date","GapSeries1","GapSeries2"] }
+ );
</script>
</body>
</html>