<li><a href="#policy">Data Policy</a></li>
</ul>
+ <h2>Features</h2>
+ <ul>
+ <li><a href="data.html">Data Formats</a></li>
+ <li><a href="annotations.html">Annotations</a></li>
+ </ul>
+
<h2>Project</h2>
<ul>
<li><a href="http://github.com/danvk/dygraphs">Source</a></li>
<h2>Gallery</h2>
<ul>
+ <li><a href="tests/">(browse demos)</a></li>
<li><a href="tests/demo.html">Basic Demo</a></li>
<li><a href="tests/gviz.html">GViz Demo</a></li>
<li><a href="tests/plotter.html">Equation Plotter</a></li>
<li><a href="tests/perf.html">Performance Test</a></li>
+ <li><a href="tests/annotation.html">Annotations</a></li>
+ <li><a href="tests/annotation-gviz.html">Annotations (GViz)</a></li>
<li><a href="tests/fillGraph.html">Filled Chart</a></li>
<li><a href="tests/perf.html">Fractions</a></li>
<li><a href="tests/visibility.html">Visibility</a></li>
<ul>
<li>Plots time series without using an external server or Flash</li>
<li>Works in Internet Explorer (using excanvas)</li>
- <li>Lightweight (45kb) and responsive</li>
+ <li>Lightweight (57kb) and responsive</li>
<li>Displays values on mouseover (this makes it easily discoverable)</li>
<li>Supports error bands around data series</li>
<li>Interactive zoom</li>
+ <li>Displays Annotations on the chart</li>
<li>Adjustable averaging period</li>
<li>Can intelligently chart fractions</li>
<li>Customizable click-through actions</li>
<h2 id="gviz">GViz Data</h2>
- <p>The <a href="http://code.google.com/apis/visualization/documentation/index.html">Google Visualization API</a> provides a standard interface for describing data. Once you've specified your data using this API, you can plug in any GViz-compatible visualization. dygraphs is such a visualization.</p>
+ <p>The <a
+ href="http://code.google.com/apis/visualization/documentation/index.html">Google
+ Visualization API</a> provides a standard interface for describing data.
+ Once you've specified your data using this API, you can plug in any
+ GViz-compatible visualization. dygraphs is such a visualization. In
+ particular, it can be used as a drop-in replacement for the
+ AnnotatedTimeline visualization used on Google Finance and other sites. To
+ see how this works, check out the <a href="tests/annotation-gviz.html">gviz
+ annotation demo.</a></p>
<p>For a simple demonstration of how to use dygraphs a GViz visualization, see <a href="http://danvk.org/dygraphs/tests/gviz.html">http://danvk.org/dygraphs/tests/gviz.html</a>. dygraphs can also be used as a GViz gadget. This allows it to be embedded inside of a Google Spreadsheet. For a demonstration of this, see <a href="http://spreadsheets.google.com/ccc?key=0Anx1yCqeL8YUdDR1c3pPREhraGhkWmdhaURjOXRncXc&hl=en">this spreadsheet</a>. The URL for the gadget is <code><a href="http://danvk.org/dygraphs/gadget.xml">http://danvk.org/dygraphs/gadget.xml</a></code>.</p>
<label for="0"> Nominal</label>
<input type=checkbox id=1 onClick="stockchange(this)" checked>
<label for="1"> Real</label>
+ <input type=checkbox id=ann onClick="annotationschange(this)" checked>
+ <label for="ann"> Annotations</label>
</p>
<script type="text/javascript">
+ var stock_annotations = [
+ {
+ series: "Real",
+ x: "1929-08-15",
+ shortText: "A",
+ text: "1929 Stock Market Peak"
+ },
+ {
+ series: "Nominal",
+ x: "1987-08-15",
+ shortText: "B",
+ text: "1987 Crash"
+ },
+ {
+ series: "Nominal",
+ x: "1999-12-15",
+ shortText: "C",
+ text: "1999 (.com) Peak"
+ },
+ {
+ series: "Nominal",
+ x: "2007-10-15",
+ shortText: "D",
+ text: "All-Time Market Peak"
+ }
+ ];
+
// From http://www.econstats.com/eqty/eq_d_mi_3.csv
stockchart = new Dygraph(
document.getElementById('dow_chart'),
{
showRoller: true,
customBars: true,
- labelsKMB: true
+ labelsKMB: true,
+ drawCallback: function(g, is_initial) {
+ if (!is_initial) return;
+ g.setAnnotations( stock_annotations );
+ }
}
);
function stockchange(el) {
stockchart.setVisibility(el.id, el.checked);
}
+
+ function annotationschange(el) {
+ if (el.checked) {
+ stockchart.setAnnotations(stock_annotations);
+ } else {
+ stockchart.setAnnotations([]);
+ }
+ }
</script>
<!--