+DygraphCanvasRenderer.prototype._renderAnnotations = function() {
+ var annotationStyle = {
+ "position": "absolute",
+ "fontSize": this.options.axisLabelFontSize + "px",
+ "zIndex": 10,
+ "width": "20px",
+ "overflow": "hidden",
+ };
+
+ // Get a list of point with annotations.
+ var points = this.layout.annotated_points;
+ for (var i = 0; i < points.length; i++) {
+ var p = points[i];
+ var div = document.createElement("div");
+ for (var name in annotationStyle) {
+ if (annotationStyle.hasOwnProperty(name)) {
+ div.style[name] = annotationStyle[name];
+ }
+ }
+ div.className = "dygraphDefaultAnnotation";
+ if (p.annotation.hasOwnProperty('cssClass')) {
+ div.className += " " + p.annotation.cssClass;
+ }
+ div.appendChild(document.createTextNode(p.annotation.shortText));
+ div.style.left = (p.canvasx - 10) + "px";
+ div.style.top = p.canvasy + "px";
+ div.title = p.annotation.text;
+ div.style.color = this.colors[p.name];
+ div.style.borderColor = this.colors[p.name];
+ this.container.appendChild(div);
+ this.annotations.push(div);
+ }
+};
+
+