title tbd
desc tbd
HTML
<script src="http://dygraphs.com/dygraph-combined.js"></script>
<div id="demodiv"></div>
JavaScript
function singleErrorPlotter(e) {
var ctx = e.drawingContext;
var points = e.points;
var g = e.dygraph;
var color = e.color;
ctx.save();
ctx.strokeStyle = e.color;
for (var i = 0; i < points.length; i++) {
var p = points[i];
var center_x = p.canvasx;
if (isNaN(p.y_bottom)) continue;
var low_y = g.toDomYCoord(p.yval_minus),
high_y = g.toDomYCoord(p.yval_plus);
ctx.beginPath();
ctx.moveTo(center_x, low_y);
ctx.lineTo(center_x, high_y);
ctx.stroke();
}
ctx.restore();
}
$(document).ready(function () {
new Dygraph(
document.getElementById('demodiv'),
[
[1, [2,0.1], [NaN,0.1]],
[2, [2,0.1], [3, 0.3]],
[3, [2,0.1], [NaN, 0.2]],
[4, [2,0.1], [2, 0.14]],
[5, [2,0.1], [4, 0.2]],
[6, [2,0.1], [3, 0.3]]
],
{
labels: ['x', 'A', 'B' ],
connectSeparatedPoints: false,
drawPoints: true,
animatedZooms: true,
errorBars: true,
'B': {
strokeWidth: 0.0,
highlightCircleSize: 10
},
plotter: [
singleErrorPlotter,
Dygraph.Plotters.linePlotter
]
}
);
}
);