this.each is not a function error throwing on geochart

396 views
Skip to first unread message

jignesh chauhan

unread,
Mar 20, 2014, 6:41:05 AM3/20/14
to google-visua...@googlegroups.com
Hello There,

I am using the geochart in order to display the map on my web page but it seems giving an error "this.each is not a function" so could any one help me out.

Here is my code

 <script type='text/javascript' src='https://www.google.com/jsapi'></script>
        <script type="text/javascript">
            google.load('visualization', '1', {'packages': ['geochart']});
        </script>

function drawMap() {
  var data = google.visualization.arrayToDataTable([
    ['Country', 'Popularity'],
    ['Germany', 200],
    ['United States', 300],
    ['Brazil', 400],
    ['Canada', 500],
    ['France', 600],
    ['RU', 700]
  ]);

  var geochart = new google.visualization.GeoChart(
      document.getElementById('chart_div'));
  geochart.draw(data, {width: 556, height: 347});
}
google.setOnLoadCallback(drawMap);


Thanks,
Jignesh

asgallant

unread,
Mar 20, 2014, 1:07:34 PM3/20/14
to google-visua...@googlegroups.com
I can't replicate the error: http://jsfiddle.net/asgallant/HkGH7/.  Are you using any other javascript frameworks?

MageGChart

unread,
Sep 27, 2015, 11:36:51 PM9/27/15
to Google Visualization API
Hi !

I know this post is old but I can't find the answer anywhere.
I tried to use Geo chart and I get the same error, I think is a conflict between geochart and prototype.js library but I try to display Geo chart in Magento and I can't disable protoype.js

So you have any idea to solve this issue ?

Thanks !

jignesh chauhan

unread,
Sep 28, 2015, 1:37:26 AM9/28/15
to google-visua...@googlegroups.com, toon...@gmail.com
Hello Tony,


Please update the prototype.js to latest version and your problem will resolved.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/EuteDAgX_og/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/1a9c715f-ec94-4a69-9339-720012f5b07f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Best Regards,
Jignesh Chauhan
Software Engineer (Magento Developer)
Mo - +91 99 98 99 97 56
India, Ahmedabad
Reply all
Reply to author
Forward
0 new messages