Make setSelection() work with missing points.
[dygraphs.git] / plugins / legend.js
index f4eb665..fb93b41 100644 (file)
@@ -122,7 +122,7 @@ var calculateEmWidthInDiv = function(div) {
 
 var escapeHTML = function(str) {
   return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
-}
+};
 
 legend.prototype.select = function(e) {
   var xValue = e.selectedX;
@@ -249,7 +249,7 @@ generateLegendHTML = function(g, x, sel_points, oneEmWidth) {
 
     // TODO(danvk): use a template string here and make it an attribute.
     html += "<span" + cls + ">" + " <b><span style='color: " + series.color + ";'>" +
-        escapeHTML(pt.name) + "</span></b>:&nbsp;" + yval + "</span>";
+        escapeHTML(pt.name) + "</span></b>:&#160;" + yval + "</span>";
   }
   return html;
 };