- div.className = "dygraphDefaultAnnotation";
- if (p.annotation.hasOwnProperty('cssClass')) {
- div.className += " " + p.annotation.cssClass;
+ if (!a.hasOwnProperty('icon')) {
+ div.className = "dygraphDefaultAnnotation";
+ }
+ if (a.hasOwnProperty('cssClass')) {
+ div.className += " " + a.cssClass;
+ }
+
+ var width = a.hasOwnProperty('height') ? a.height : 20;
+ var height = a.hasOwnProperty('width') ? a.width : 16;
+ if (a.hasOwnProperty('icon')) {
+ var img = document.createElement("img");
+ img.src = a.icon;
+ img.width = width = a.iconWidth;
+ img.height = height = a.iconHeight;
+ div.appendChild(img);
+ } else if (p.annotation.hasOwnProperty('shortText')) {
+ div.appendChild(document.createTextNode(p.annotation.shortText));