+
+AnnotationsTestCase.prototype.testAnnotationsDrawnInDrawCallback = function() {
+ var data = "X,Y\n" +
+ "0,-1\n" +
+ "1,0\n" +
+ "2,1\n";
+
+ var graph = document.getElementById("graph");
+
+ var calls = [];
+ var g = new Dygraph(graph, data, {
+ width: 480,
+ height: 320,
+ drawCallback: function(g, initial) {
+ calls.push(initial);
+ if (initial) {
+ g.setAnnotations([
+ {
+ series: 'Y',
+ x: 1,
+ shortText: 'A',
+ text: 'Long A',
+ },
+ ]);
+ }
+ }
+ });
+
+ assertEquals([true, false], calls);
+};