diff --git a/plugins/UserCountryMap/javascripts/visitor-map.js b/plugins/UserCountryMap/javascripts/visitor-map.js index 1c7322c65123e1211436762cad7ef613f4bd0513..f49f7ede951c7e982d42f15fc49a41d67b3a2c69 100644 --- a/plugins/UserCountryMap/javascripts/visitor-map.js +++ b/plugins/UserCountryMap/javascripts/visitor-map.js @@ -195,7 +195,7 @@ $('.UserCountryMap-legend .content').append(r); } - var stats, values = [], id = self.lastSelected, c; + var stats, values = [], id = self.lastSelected, c, showLegend; $.each(rows, function (i, r) { if (!$.isFunction(filter) || filter(r)) { @@ -205,12 +205,15 @@ }); stats = minmax(values); + showLegend = values.length > 0; if (stats.min == stats.max) { colscale = function () { return chroma.hex(oneCountryColor); }; if (choropleth) { $('.UserCountryMap-legend .content').html('').show(); - addLegendItem(stats.min, true); + if (showLegend) { + addLegendItem(stats.min, true); + } } return colscale; } @@ -231,7 +234,7 @@ } // a good place to update the legend, isn't it? - if (choropleth) { + if (choropleth && showLegend) { $('.UserCountryMap-legend .content').html('').show(); var itemExists = {}; $.each(chroma.limits(values, 'k', 3), function (i, v) { diff --git a/plugins/UserCountryMap/stylesheets/visitor-map.less b/plugins/UserCountryMap/stylesheets/visitor-map.less index b2e1edb95b75a86d770a09a3e7a3cc4dd6494fc7..cc239abc64075466549865cc4cf8d1972e3a246e 100644 --- a/plugins/UserCountryMap/stylesheets/visitor-map.less +++ b/plugins/UserCountryMap/stylesheets/visitor-map.less @@ -43,7 +43,7 @@ .UserCountryMap-tooltip { display: block; position: absolute; - z-index: 9; + z-index: 40; } .UserCountryMap-overlay .content,