Thanks Robert. Sorry, but I do have that...that was just a slight mistype
in my example. I'm really sorry I didn't copy and paste the code.
Here's my code:
*function gotoPage(url)
{
window.top.location.href = url;
}
google.load('visualization', '1', {'packages': ['geomap']});
google.setOnLoadCallback(drawMap);
function drawMap() {
var data = new google.visualization.DataTable();
data.addRows(35);
data.addColumn('string', 'Country');
data.addColumn('number', 'Amount');
data.setValue(0, 0, "Afghanistan");
data.setValue(0, 1, 1);
data.setValue(1, 0, "Algeria");
data.setValue(1, 1, 4);
data.setValue(2, 0, "Australia");
data.setValue(2, 1, 11);
data.setValue(3, 0, "Austria");
.
.
.
data.setValue(33, 0, "Vietnam");
data.setValue(33, 1, 1);
var options = {};
options['dataMode'] = 'regions';
options['region'] = 'world';
options['showLegend'] = true;
if(options['dataMode'] == "markers")
{
options['showZoomOut'] = true;
options['zoomOutLabel'] = "View All Nations";
}
var container = document.getElementById('country_map');
var geomap = new google.visualization.GeoMap(container);
geomap.draw(data, options);
google.visualization.events.addListener(geomap, 'zoomOut',
function() {
gotoPage("country.html");
});
google.visualization.events.addListener(geomap, 'regionClick',
function(e) {
gotoPage("country.html?country_code=" + e['region']);
});
};
*
My friend confirmed for me it works in IE 7 last night so that's good. I'm
still having trouble with it in IE 8 though.
Thanks!
Mike
On Wed, May 13, 2009 at 7:03 AM, Robert <[email protected]> wrote:
>
> you need a ; after alert() and before the closing bracket of the
> function-
>
> google.visualization.events.addListener(geomap, 'regionClick',
> function () {alert("HEY")});
>
> should be
>
> google.visualization.events.addListener(geomap, 'regionClick', function
> () {alert("HEY");});
>
> --Robert
>
> On May 13, 1:16 am, Mike <[email protected]> wrote:
> > Sorry, I should've put this in my first message. I'm getting the
> > error in IE when I click on a country and do:
> >
> > google.visualization.events.addListener(geomap, 'regionClick', function
> > () {alert("HEY")});
> >
> > Thanks again!
> >
> > On May 12, 6:53 am, VizBoy <[email protected]> wrote:
> >
> > > This doesn't seem like a problem with the API, but rather with your
> html
> > > page. Perhaps a bad encoding, or some bad character in the doctype
> > > definition?
> >
> > > Could you try going into one of our example pages and see if it works
> for
> > > you?
> > > For instance,
> http://code.google.com/apis/visualization/documentation/gallery/motio...
> >
> > > - VizBoy.
> >
> > > On Fri, May 8, 2009 at 8:03 AM, eden <[email protected]> wrote:
> >
> > > > I am having trouble getting the motion chart to display data in IE 7.
> > > > I used the example page as below:
> >
> > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> > > > <html>
> > > > <head>
> > > > <title></title>
> > > > <meta http-equiv="Content-Type" content="text/html;
> > > > charset=UTF-8">
> > > > <script type="text/javascript" src="http://www.google.com/jsapi
> "></
> > > > script>
> > > > <script type="text/javascript">
> > > > google.load('visualization', '1', {'packages':
> > > > ['motionchart']});
> > > > google.setOnLoadCallback(drawChart);
> >
> > > > function drawChart()
> > > > {
> > > > var data = new google.visualization.DataTable();
> > > > data.addRows(6);
> > > > data.addColumn('string', 'Fruit');
> > > > data.addColumn('date', 'Date');
> > > > data.addColumn('number', 'Sales');
> > > > data.addColumn('number', 'Expenses');
> > > > data.addColumn('string', 'Location');
> > > > data.setValue(0, 0, 'Apples');
> > > > data.setValue(0, 1, new Date (1988,0,1));
> > > > data.setValue(0, 2, 1000);
> > > > data.setValue(0, 3, 300);
> > > > data.setValue(0, 4, 'East');
> > > > data.setValue(1, 0, 'Oranges');
> > > > data.setValue(1, 1, new Date (1988,0,1));
> > > > data.setValue(1, 2, 950);
> > > > data.setValue(1, 3, 200);
> > > > data.setValue(1, 4, 'West');
> > > > data.setValue(2, 0, 'Bananas');
> > > > data.setValue(2, 1, new Date (1988,0,1));
> > > > data.setValue(2, 2, 300);
> > > > data.setValue(2, 3, 250);
> > > > data.setValue(2, 4, 'West');
> > > > data.setValue(3, 0, 'Apples');
> > > > data.setValue(3, 1, new Date(1988,1,1));
> > > > data.setValue(3, 2, 1200);
> > > > data.setValue(3, 3, 400);
> > > > data.setValue(3, 4, "East");
> > > > data.setValue(4, 0, 'Oranges');
> > > > data.setValue(4, 1, new Date(1988,1,1));
> > > > data.setValue(4, 2, 900);
> > > > data.setValue(4, 3, 150);
> > > > data.setValue(4, 4, "West");
> > > > data.setValue(5, 0, 'Bananas');
> > > > data.setValue(5, 1, new Date(1988,1,1));
> > > > data.setValue(5, 2, 788);
> > > > data.setValue(5, 3, 617);
> > > > data.setValue(5, 4, "West");
> > > > var chart = new google.visualization.MotionChart
> > > > (document.getElementById('visualisation'));
> > > > chart.draw(data, {width: 600, height:300});
> > > > }
> > > > </script>
> > > > </head>
> > > > <body>
> > > > <div id="visualisation" style="width: 600px; height: 300px;"></
> > > > div>
> > > > </body>
> > > > </html>
> >
> > > > This works perfectly in Firefox and Chrome. In IE I get an error on
> > > > Line 1 Char 40 saying Expected ';'. Does anyone have any ideas?
> >
> > > > Cheers,
> >
> > > > Eden
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---