forked from danvk/dygraphs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jsdoc for setAnnotations() and an example of how to use them with…
… native-format dates.
- Loading branch information
Dan Vanderkam
committed
Dec 9, 2011
1 parent
fbff6d7
commit 41ee764
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9"> | ||
<title>Native format annotations</title> | ||
<!--[if IE]> | ||
<script type="text/javascript" src="../excanvas.js"></script> | ||
<![endif]--> | ||
<script type="text/javascript" src="../dygraph-dev.js"></script> | ||
</head> | ||
<body> | ||
<p>This test demonstrates how annotations can be used with <a href="http://dygraphs.com/data.html#array">native-format</a> data.</p> | ||
|
||
<div id="demodiv"></div> | ||
|
||
<script type="text/javascript"> | ||
g = new Dygraph( | ||
document.getElementById("demodiv"), | ||
[ | ||
[ new Date("2011/11/01"), 100 ], | ||
[ new Date("2011/11/02"), 200 ], | ||
[ new Date("2011/11/03"), 300 ], | ||
[ new Date("2011/11/04"), 100 ], | ||
[ new Date("2011/11/05"), 200 ], | ||
[ new Date("2011/11/06"), 300 ], | ||
[ new Date("2011/11/07"), 200 ], | ||
[ new Date("2011/11/08"), 100 ] | ||
], | ||
{ | ||
labels: [ 'Date', 'Value' ] | ||
} | ||
); | ||
|
||
g.setAnnotations([{ | ||
series: 'Value', | ||
x: Date.parse('2011/11/04'), | ||
shortText: 'M', | ||
text: 'Marker' | ||
}]); | ||
</script> | ||
</body> | ||
</html> |