Х3 кто,
вариант ... замените весь код на это
$(function() {
$("#test").change(function() {
var pok = this.value;
var namepok = this.options[this.selectedIndex].text;
var temp_array = regions.map(function(item) {
return item[pok]
});
var highest_value = Math.max.apply(Math, temp_array);
regions.forEach(function(el) {
var title = el.region_name + "<br>" + namepok + " " + el[pok];
$("#" + el.region_code).css({
"fill": "rgba(0,255,100," + el[pok] / highest_value + ")"
}).data("title", title)
})
}).change();
var info_panel = $('<div class="info_panel">').appendTo("body").hide();
$(".map").on("mouseenter", "g",
function(e) {
var title = $(this).data("title");
info_panel.html(title).show()
})
.mouseleave(function() {
info_panel.hide()
})
.mousemove(function(e) {
var mouseX = e.pageX,
mouseY = e.pageY;
info_panel.css({
top: mouseY - 50,
left: mouseX - info_panel.width() / 2
})
})
});