+ * Update the list of annotations and redraw the chart.
+ */
+Dygraph.prototype.setAnnotations = function(ann) {
+ this.annotations_ = ann;
+ this.layout_.setAnnotations(this.annotations_);
+ this.drawGraph_(this.rawData_);
+};
+
+/**
+ * Return the list of annotations.
+ */
+Dygraph.prototype.annotations = function() {
+ return this.annotations_;
+};
+
+Dygraph.addAnnotationRule = function() {
+ if (Dygraph.addedAnnotationCSS) return;
+
+ var mysheet=document.styleSheets[0]
+ var totalrules=mysheet.cssRules? mysheet.cssRules.length : mysheet.rules.length
+ var rule = "border: 1px solid black; " +
+ "background-color: white; " +
+ "text-align: center;";
+ if (mysheet.insertRule) { // Firefox
+ mysheet.insertRule(".dygraphDefaultAnnotation { " + rule + " }");
+ } else if (mysheet.addRule) { // IE
+ mysheet.addRule(".dygraphDefaultAnnotation", rule);
+ }
+
+ Dygraph.addedAnnotationCSS = true;
+}
+
+/**