projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
88bf33a
)
add annotation CSS rule lazily
author
Dan Vanderkam
<danvk@google.com>
Wed, 13 Oct 2010 14:35:27 +0000
(10:35 -0400)
committer
Dan Vanderkam
<danvk@google.com>
Wed, 13 Oct 2010 14:35:27 +0000
(10:35 -0400)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
522533d
..
6396ef2
100644
(file)
--- 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);
// 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_();
// 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) {
* 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) {
this.annotations_ = ann;
this.layout_.setAnnotations(this.annotations_);
if (!suppressDraw) {