Add temperature-sf-ny. We should rename it.
authorRobert Konigsberg <konigsberg@google.com>
Sun, 15 Jan 2012 16:43:02 +0000 (11:43 -0500)
committerRobert Konigsberg <konigsberg@google.com>
Sun, 15 Jan 2012 16:43:02 +0000 (11:43 -0500)
gallery/gallery.css
gallery/index.html
gallery/temperature-sf-ny.js [new file with mode: 0644]

index c0b81d7..37462cf 100644 (file)
@@ -119,6 +119,10 @@ aside {
 
 #workarea #styled-chart-labels .chart {
   border: 1px dashed black;
-  margin: 5px 5px 5px 50px;
+  margin: 5px  5px 5px 50px;
   padding: 2px;
-}
\ No newline at end of file
+}
+
+@workarea #temperature-sf-ny #bordered {
+  border: 1px solid red;
+}
index 5e77abc..f1bdf1e 100644 (file)
@@ -26,6 +26,7 @@
     <script src="resize.js"></script>
     <script src="stock.js"></script>
     <script src="styled-chart-labels.js"></script>
+    <script src="temperature-sf-ny.js"></script>
 
     <!-- These might not remain in the gallery -->
     <script src="dygraph-simple.js"></script>
diff --git a/gallery/temperature-sf-ny.js b/gallery/temperature-sf-ny.js
new file mode 100644 (file)
index 0000000..8f43d1e
--- /dev/null
@@ -0,0 +1,40 @@
+Gallery.register(
+  // Get a better name.
+  'temperature-sf-ny',
+  {
+    name: 'Roll Periods and Error Bars',
+    title: 'Demo of a graph with many data points and custom error bars.',
+    setup: function(parent) {
+      parent.innerHTML =
+          "<p>Roll period of 14 timesteps.</p>" +
+          "<div id='roll14' style='width:800px; height:320px;'></div>" +
+          "<p>No roll period.</p>" +
+          "<div id='noroll' style='width:800px; height:320px;'></div>";
+    },
+    run: function() {
+      g1 = new Dygraph(
+          document.getElementById("noroll"),
+          data_temp,
+          {
+            customBars: true,
+            title: 'Daily Temperatures in New York vs. San Francisco',
+            ylabel: 'Temperature (F)',
+            legend: 'always',
+            labelsDivStyles: { 'textAlign': 'right' }
+          }
+      );
+      g2 = new Dygraph(
+          document.getElementById("roll14"),
+          data_temp,
+          {
+            rollPeriod: 14,
+            showRoller: true,
+            customBars: true,
+            title: 'Daily Temperatures in New York vs. San Francisco',
+            ylabel: 'Temperature (F)',
+            legend: 'always',
+            labelsDivStyles: { 'textAlign': 'right' }
+          }
+      );
+    }
+  });
\ No newline at end of file