Add variable declarations for most all graphs and charts.
authorRobert Konigsberg <konigsberg@google.com>
Sat, 7 Jan 2012 13:12:07 +0000 (08:12 -0500)
committerRobert Konigsberg <konigsberg@google.com>
Sat, 7 Jan 2012 13:12:07 +0000 (08:12 -0500)
22 files changed:
tests/avoidMinZero.html
tests/border.html
tests/connect-separated.html
tests/custom-bars.html
tests/draw-points.html
tests/fillGraph.html
tests/fractions.html
tests/gviz-infinity.html
tests/gviz.html
tests/highlighted-region.html
tests/independent-series.html
tests/is-zoomed.html
tests/isolated-points.html
tests/labelsKMB.html
tests/negative.html
tests/no-range.html
tests/out-of-order.html
tests/small-range-zero.html
tests/unboxed-spark.html
tests/x-axis-formatter.html
tests/y-axis-formatter.html
tests/zero-series.html

index 27ea8f5..c7f1629 100644 (file)
@@ -17,7 +17,7 @@
     <p>1: Line chart with axis at zero problem:</p>
     <div id="graph1"></div>
     <script type="text/javascript">
-        new Dygraph(document.getElementById("graph1"),
+        var g1 = new Dygraph(document.getElementById("graph1"),
             "Date,Temperature\n" +
             "2008-05-07,0\n" +
             "2008-05-08,1\n" +
@@ -31,7 +31,7 @@
     <p>2: Step chart with axis at zero problem:</p>
     <div id="graphd2"></div>
     <script type="text/javascript">
-        new Dygraph(document.getElementById("graphd2"),
+        var g2 = new Dygraph(document.getElementById("graphd2"),
             "Date,Temperature\n" +
             "2008-05-07,0\n" +
             "2008-05-08,1\n" +
@@ -48,7 +48,7 @@
     <p>3: Line chart with <code>avoidMinZero</code> option:</p>
     <div id="graph3"></div>
     <script type="text/javascript">
-        new Dygraph(document.getElementById("graph3"),
+        var g3 = new Dygraph(document.getElementById("graph3"),
             "Date,Temperature\n" +
             "2008-05-07,0\n" +
             "2008-05-08,1\n" +
@@ -65,7 +65,7 @@
     <p>4: Step chart with <code>avoidMinZero</code> option:</p>
     <div id="graphd4"></div>
     <script type="text/javascript">
-        new Dygraph(document.getElementById("graphd4"),
+        var g4 = new Dygraph(document.getElementById("graphd4"),
             "Date,Temperature\n" +
             "2008-05-07,0\n" +
             "2008-05-08,1\n" +
index 5dd6d03..63851d0 100644 (file)
@@ -23,7 +23,7 @@
     <p>Hopefully this stays in its border:</p>
     <div id="bordered" style="width:600px; height:300px;"></div>
     <script type="text/javascript">
-    new Dygraph(document.getElementById('bordered'), data,
+    var g = new Dygraph(document.getElementById('bordered'), data,
     {
       labelsDivStyles: { border: '1px solid black' },
       title: 'Chart Title',
index 608396c..96dd9a5 100644 (file)
@@ -20,7 +20,7 @@
 
     <div id="graphdiv" style="width:600px; height:300px;"></div>
     <script type="text/javascript">
-      new Dygraph(document.getElementById("graphdiv"),
+      var g = new Dygraph(document.getElementById("graphdiv"),
       [
         [ new Date("2009/12/01"), 10, 10, 10],
         [ new Date("2009/12/02"), 15, 11, 12],
index 5dd2617..6fa8762 100644 (file)
@@ -19,7 +19,7 @@
     <div id="graph"></div>
 
     <script type="text/javascript">
-      new Dygraph(document.getElementById("graph"),
+      var g = new Dygraph(document.getElementById("graph"),
                   [
                     [1, [10,  10, 100]],
                     [2, [15,  20, 110]],
index 3d66cb9..6ab0a2d 100644 (file)
@@ -20,7 +20,7 @@
     <div id="g2" style="width:600px; height:300px;"></div>
 
     <script type="text/javascript">
-      new Dygraph(
+      var g1 = new Dygraph(
           document.getElementById("g"),
           NoisyData, {
             rollPeriod: 7,
@@ -29,7 +29,7 @@
           }
         );
 
-      new Dygraph(
+      var g2 = new Dygraph(
           document.getElementById("g2"),
           NoisyData, {
             rollPeriod: 7,
index 1baf6e5..9e2a22f 100644 (file)
@@ -24,7 +24,7 @@
     <div id="div_g3" style="width:600px; height:300px;"></div>
 
     <script type="text/javascript">
-      new Dygraph(
+      var g1 = new Dygraph(
         document.getElementById("div_g"),
         function() {
           var ret = "X,Y1,Y2\n";
@@ -36,7 +36,7 @@
         { fillGraph: true }
       );
 
-      new Dygraph(
+      var g2 = new Dygraph(
         document.getElementById("div_g2"),
         function() {
           var ret = "X,Y1,Y2\n";
@@ -49,7 +49,7 @@
         { fillGraph: true }
       );
 
-      new Dygraph(
+      var g3 = new Dygraph(
         document.getElementById("div_g3"),
         function() {
           var ret = "X,Y1,Y2\n";
index 7af7eec..dead732 100644 (file)
                   "3,2/3,17/49\n"+
                   "4,25/30,100/200";
 
-      new Dygraph(document.getElementById("dg"),
+      var g1 = new Dygraph(document.getElementById("dg"),
                   frac_str,
                   {
                     fractions: true
                   });
 
-      new Dygraph(document.getElementById("dg2"),
+      var g2 = new Dygraph(document.getElementById("dg2"),
                   frac_str,
                   {
                     fractions: true,
index 3a5e17f..259c420 100644 (file)
         new google.visualization.LineChart(
             document.getElementById('gviz')).draw(data, null);
 
-        new Dygraph.GVizChart(document.getElementById('dygraphs'))
+        var chart1 = new Dygraph.GVizChart(document.getElementById('dygraphs'))
           .draw(data, { });
 
         data = createDataTable('datetime');
-        new Dygraph.GVizChart(
+        var chart2 = new Dygraph.GVizChart(
             document.getElementById('dygraphs_datetime')).draw(data, {
             });
       }
index 8ff321b..707f6ac 100644 (file)
         new google.visualization.LineChart(
             document.getElementById('gviz')).draw(data, null);
 
-        new Dygraph.GVizChart(
+        var chart1 = new Dygraph.GVizChart(
             document.getElementById('dygraphs')).draw(data, {
             });
 
         data = createDataTable('datetime');
-        new Dygraph.GVizChart(
+        var chart2 = new Dygraph.GVizChart(
             document.getElementById('dygraphs_datetime')).draw(data, {
             });
 
index 8a569ad..588ddc4 100644 (file)
@@ -36,7 +36,7 @@
       }
 
 
-      new Dygraph(
+      var g = new Dygraph(
           document.getElementById("div_g"),
           data,
           {
index d0ac975..7e58976 100644 (file)
@@ -83,7 +83,7 @@
     </tr></table>
 
     <script type="text/javascript">
-    new Dygraph(
+    var g1 = new Dygraph(
       document.getElementById("graph"),
       [
         [1, null, 3],
index 7aa1da2..4b9bb92 100644 (file)
@@ -33,7 +33,7 @@
       <div class="codeoutput" style="float:left;">
       <div id="zoomdiv"></div>
       <script type="text/javascript">
-        new Dygraph(
+        var g = new Dygraph(
   
         // containing div
         document.getElementById("zoomdiv"),
index 6043e04..c09048d 100644 (file)
@@ -16,7 +16,7 @@
   <body>
     <div id="graph"></div>
     <script type="text/javascript">
-    new Dygraph(
+    var g = new Dygraph(
       document.getElementById("graph"),
       [
         [ 1, 10, 11],
index 7f3b361..2be418e 100644 (file)
@@ -48,9 +48,9 @@
           suffixes[magnitude];
       }
 
-      new Dygraph(document.getElementById("labelsKMB"), data, { labelsKMB: true });
-      new Dygraph(document.getElementById("labelsKMG2"), data, { labelsKMG2: true });
-      var g = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data,
+      var g = new Dygraph(document.getElementById("labelsKMB"), data, { labelsKMB: true });
+      var g2 = new Dygraph(document.getElementById("labelsKMG2"), data, { labelsKMG2: true });
+      var g3 = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data,
                           { labelsKMG2: true, yValueFormatter: formatValue });
     </script>
   </body>
index 475ea17..2f4cf8e 100644 (file)
         pos.push([i, 1000 + 2 * i, 1100 + i]);
       }
 
-      new Dygraph(
+      var g1 = new Dygraph(
         document.getElementById("g1"),
         negs, { labels: [ 'x', 'y1', 'y2' ] }
       );
 
-      new Dygraph(
+      var g2 = new Dygraph(
         document.getElementById("g2"),
         mixed, { labels: [ 'x', 'y1', 'y2' ] }
       );
 
-      new Dygraph(
+      var g3 = new Dygraph(
         document.getElementById("g3"),
         pos, { labels: [ 'x', 'y1', 'y2' ] }
       );
index 26a2c0f..656654a 100644 (file)
     <div id="blah2"></div>
 
     <script type="text/javascript">
-    new Dygraph(document.getElementById("blah"),
+    var g1 = new Dygraph(document.getElementById("blah"),
                 "X,Y\n10,12345\n11,12345\n",
                 { width: 640, height: 480 });
 
-    new Dygraph(document.getElementById("blah2"),
+    var g2 = new Dygraph(document.getElementById("blah2"),
 "date,10M\n" +
 "20021229,10000000.000000\n" +
 "20030105,10000000.000000\n" +
index 45de841..10ad58d 100644 (file)
       function drawVisualization() {
         data = createDataTable('date');
 
-        new Dygraph.GVizChart(
+        var chart = new Dygraph.GVizChart(
             document.getElementById('dygraphs_gviz')).draw(data, {
             });
 
-        new Dygraph(document.getElementById('dygraphs'), csv);
+        var graph = new Dygraph(document.getElementById('dygraphs'), csv);
 
       }
       google.setOnLoadCallback(drawVisualization);
index db84cbf..a6492dc 100644 (file)
@@ -24,7 +24,7 @@
       return "date," + label + "\n20091206,2659329.631743\n20091213,2772361.123362\n20091220,2737584.647191\n20091227,2720000.550414\n20100103,2910306.897977\n20100110,2901385.313093\n20100117,2903041.312099\n20100124,2966455.128911\n";
     }
 
-    new Dygraph(document.getElementById("blah"),
+    var g1 = new Dygraph(document.getElementById("blah"),
                 CSV,
                 {
                   width: 640,
@@ -55,7 +55,7 @@
           str += data[i].join(",") + "\n";
         }
 
-        new Dygraph(document.getElementById("blah2"),
+        var g2 = new Dygraph(document.getElementById("blah2"),
                     str,
                     { labels: [ "date", "zero", "non-zero" ] });
     </script>
index cb24df5..dcbaafe 100644 (file)
@@ -54,7 +54,7 @@
     </p>
 
     <script type="text/javascript">
-      new Dygraph(
+      var g2 = new Dygraph(
             document.getElementById("div_spark"),
             data, {
               drawXAxis: false,
index b008ad8..d216c97 100644 (file)
           "2009/07/12 06:00:00,4,6"
       }
 
-      new Dygraph(
+      var g1 = new Dygraph(
             document.getElementById("normal"),
             HourlyData()
           );
 
-      new Dygraph(
+      var g2 = new Dygraph(
             document.getElementById("offby2"),
             HourlyData(),
             { 
@@ -54,7 +54,7 @@
               }
             });
 
-      new Dygraph(
+      var g3 = new Dygraph(
             document.getElementById("seconds"),
             HourlyData(),
             { 
index f2fbd00..76f6ffd 100644 (file)
@@ -21,7 +21,7 @@
         (this was more of a problem before dygraphs automatically switched to scientific notation)</p>
         <div id="graph1"></div>
         <script type="text/javascript">
-            new Dygraph(
+            var g1 = new Dygraph(
                 document.getElementById("graph1"),
                 [
                     [1, 0.0],
@@ -40,7 +40,7 @@
         <p>The solution using a Y axis formatting function:</p>
         <div id="graph2"></div>
         <script type="text/javascript">
-            new Dygraph(
+            var g2 = new Dygraph(
                 document.getElementById("graph2"),
                 [
                     [1, 0.0],
@@ -67,7 +67,7 @@
         <p>Different yValueFormatter and yAxisLabelFormatter functions:</p>
         <div id="graph3"></div>
         <script type="text/javascript">
-            new Dygraph(
+            var g3 = new Dygraph(
                 document.getElementById("graph3"),
                 [
                     [1, 0.0],
index 1f4d0b1..8a94393 100644 (file)
@@ -24,7 +24,7 @@
 
     <div id="graphdiv" style="width:600px; height:300px;"></div>
     <script type="text/javascript">
-      new Dygraph(document.getElementById("graphdiv"),
+      var g = new Dygraph(document.getElementById("graphdiv"),
           document.getElementById("data").innerHTML,
           {
             customBars: true