From 3c51ab748119e70ad44691d062a38c7e026158eb Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 13 Oct 2010 10:35:27 -0400 Subject: [PATCH] add annotation CSS rule lazily --- dygraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dygraph.js b/dygraph.js index 522533d..6396ef2 100644 --- a/dygraph.js +++ b/dygraph.js @@ -233,8 +233,6 @@ Dygraph.prototype.__init__ = function(div, file, attrs) { // Make a note of whether labels will be pulled from the CSV file. this.labelsFromCSV_ = (this.attr_("labels") == null); - Dygraph.addAnnotationRule(); - // Create the containing DIV and other interactive elements this.createInterface_(); @@ -2446,6 +2444,8 @@ Dygraph.prototype.setVisibility = function(num, value) { * Update the list of annotations and redraw the chart. */ Dygraph.prototype.setAnnotations = function(ann, suppressDraw) { + // Only add the annotation CSS rule once we know it will be used. + Dygraph.addAnnotationRule(); this.annotations_ = ann; this.layout_.setAnnotations(this.annotations_); if (!suppressDraw) { -- 2.7.4