Clear graph when numAxes goes from 1 -> 2 in updateOptions
[dygraphs.git] / gallery / highlighted-region.js
index 4a13d1e..78955d6 100644 (file)
@@ -1,12 +1,13 @@
+/*global Gallery,Dygraph,data */
 Gallery.register(
   'highlighted-region',
   {
     name: 'Highlighted Region',
     title: 'Draws a time series with an unusual region highlighted',
     setup: function(parent) {
-      parent.innerHTML = 
-        "<div id='div_g' style='width:600px; height:300px;'></div>" +
-        "<p>When you zoom and pan, the region remains highlighted.</p>";
+      parent.innerHTML = [
+        "<div id='div_g' style='width:600px; height:300px;'></div>",
+        "<p>When you zoom and pan, the region remains highlighted.</p>"].join("\n");
     },
     run: function() {
       // A basic sinusoidal data series.
@@ -23,7 +24,7 @@ Gallery.register(
         data[i][2] += 5.0;
       }
 
-      var g = new Dygraph(
+      new Dygraph(
           document.getElementById("div_g"),
           data,
           {