Fix lint errors in gallery and add its JS files to lint.sh
[dygraphs.git] / gallery / highlighted-series.js
index 8cbe3c8..b5ac642 100644 (file)
@@ -57,9 +57,17 @@ var makeGraph = function(className, numSeries, numRows, isStacked) {
         highlightSeriesOpts: {
           strokeWidth: 3,
           strokeBorderWidth: 1,
-          highlightCircleSize: 5,
-        },
+          highlightCircleSize: 5
+        }
       });
+  var onclick = function(ev) {
+    if (g.isSeriesLocked()) {
+      g.clearSelection();
+    } else {
+      g.setSelection(g.getSelection(), g.getHighlightSeries(), true);
+    }
+  };
+  g.updateOptions({clickCallback: onclick}, true);
   g.setSelection(false, 's005');
   //console.log(g);
 };