Commit | Line | Data |
---|---|---|
20b87d28 DV |
1 | <!DOCTYPE html> |
2 | <html> | |
3 | <head> | |
93a5bb4c | 4 | <link rel="stylesheet" href="../css/dygraph.css"> |
20b87d28 | 5 | <title>dense, filled plots</title> |
fbd6834a | 6 | <script type="text/javascript" src="../dist/dygraph.js"></script> |
20b87d28 DV |
7 | <style> |
8 | .chart { | |
9 | width: 800px; | |
10 | height: 500px; | |
11 | } | |
12 | </style> | |
13 | </head> | |
14 | <body> | |
15 | <p>These charts are substantially sped up by <a href="https://github.com/danvk/dygraphs/pull/462/">down-sampling.</a></p> | |
16 | <div class="chart" data-opts='{"fillGraph":true}'></div> | |
17 | ||
18 | <p>step plot, filled</p> | |
19 | <div class="chart" data-opts='{"fillGraph":true,"stepPlot":true}'></div> | |
20 | ||
21 | <script> | |
22 | var data = []; | |
23 | for (var i = 0; i < 10000; i++) { | |
24 | data.push([i, Math.sin(i/1000), Math.cos(i/1000)]); | |
25 | } | |
26 | ||
27 | var chartDivs = document.querySelectorAll('.chart'); | |
28 | for (var i = 0; i < chartDivs.length; i++) { | |
29 | var chartDiv = chartDivs[i]; | |
30 | var opts = {labels: ['X', 'sin', 'cos'], animatedZooms: true}; | |
31 | var thisOpts = JSON.parse(chartDiv.getAttribute('data-opts')); | |
32 | for (var k in thisOpts) { | |
33 | opts[k] = thisOpts[k]; | |
34 | } | |
35 | ||
36 | new Dygraph(chartDivs[i], data, opts); | |
37 | } | |
38 | </script> | |
39 | </body> | |
40 | </html> |