Posting without extraneous code.
I have been having problems with GeoChart for a few days now. The
hover/tooltip property has stopped working! So the "click" even still
works, but there is no feedback to the user as to what country they
are hovering over. I have eliminated the possibility of the error
being with the code I have written (see below) because I tried the
example code from the GeoChart webpage, and that rendered the same
error (see screenshots attached below). I don't know what to do,
please help!
Thanks,
Sarah
Error in Chrome: "Object #<NodeList> has no method 'each'"
http://i46.tinypic.com/20zz41v.png
Error in Safari: "'undefined' is not a function"
http://i46.tinypic.com/r2nw53.png
variables:
- countries: list of all "active" countries (ID format: "AF", etc.)
- names: list of all "active" countries (Name format: "Afghanistan",
etc.)
google.load("visualization", "1", {"packages":
["geochart"]});
google.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = new
google.visualization.DataTable();
data.addRows(numbers.length);
data.addColumn("string", "CountryID");
data.addColumn("string", "Country");
data.addColumn("number", "Programs");
data.addColumn({type:'string',
role:'tooltip'});
for (var i=0; i<numbers.length; i++) {
data.setValue(i, 0, countries[i]);
data.setValue(i, 1, names[i]);
data.setValue(i, 2, 200);
data.setValue(i, 3, "Programs: ");
}
var options = {width: 1.4*556, height: 1.4*347, backgroundColor:
"#E3E6D5", datalessRegionColor:"#BCDFC3", colors: ["#FC8767",
"#FC8767"], legend:"none"};
var container = document.getElementById("visualization");
var geochart = new google.visualization.GeoChart(container);
google.visualization.events.addListener(geochart, "regionClick",
function(eventData) {
document.location = "
http://volunteervoice.herokuapp.com/
pages/"+eventData.region+"/searches";
});
geochart.draw(data, options);
};