intensity map

40 views
Skip to first unread message

jade k

unread,
Dec 8, 2011, 11:57:28 PM12/8/11
to Google Visualization API
Hi I am trying to make an intensity map using Gapminder data from a
google spreadsheet. I am using a slider to select the data, and
querying from 5 spreadsheets for different indicators. It is almost
complete, everything is working except for two problems.
When I change the slider to select a new year, every other change
hangs at "the visualization is currently loading." If I move the
slider again, it redraws the map correctly. I did a sloppy fix of
putting two draws in a row and that fixed it...
geochart.draw
geochart.draw

But is there a better way to fix it?

Also, after I have changed the year a couple times, everything on the
chart goes crazy. The chart will stay normal sometimes, and then it
will randomly switch back and forth to old maps. If I hover over the
countries, it displays the wrong year. I tried setting breakpoints in
firebug, but my drraw function is not being called.

What's going on? thanks

asgallant

unread,
Dec 9, 2011, 9:37:44 AM12/9/11
to google-visua...@googlegroups.com
Can you post your javascript?

Riccardo Govoni ☢

unread,
Dec 9, 2011, 10:04:14 AM12/9/11
to google-visua...@googlegroups.com
Do you have an example or sample page that isolates the problem? I understand you are using a google.visualization.NumberRangeFilter and a geochart, but it's difficult to understand whether the error comes from within the library or not, based on just the description of it.

Thanks,
- R.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Message has been deleted

jade k

unread,
Dec 9, 2011, 11:55:38 PM12/9/11
to Google Visualization API
thanks for responding. My solution was just to instantiate a new map
after every query. This isn't as smooth as a change as just redrawing
the map though. It like flashes out for a second. Is there anyways I
can just redraw the map with new data?

function handleQueryResponse(response){
if(response.isError()){ alert('Error in query: ' +
response.getMessage() + ' ' + response.getDetailedMessage());}
var data = response.getDataTable();
if(my_init)
{
var options = {'width': 750, 'height': 400};
var container = document.getElementById('map_canvas');
var geochart = new google.visualization.GeoChart(container);
my_init = false;
initializeSlider();
geochart.draw(data, options);
}
else
{
var options = {'width': 750, 'height': 400};
var container = document.getElementById('map_canvas');
var geochart = new google.visualization.GeoChart(container);
geochart.draw(data, options);
}
}

jade k

unread,
Dec 10, 2011, 12:00:27 AM12/10/11
to Google Visualization API
This is how I tried to do it at first:

function handleQueryResponse(response){
if(response.isError()){ alert('Error in query: ' +
response.getMessage() + ' ' + response.getDetailedMessage());}

data = response.getDataTable();
if(my_init)
{


options = {'width': 750, 'height': 400};

container = document.getElementById('map_canvas');

geochart = new google.visualization.GeoChart(container);
my_init = false;
initializeSlider();
geochart.draw(data, options);
}
else
{

geochart.draw(data, options);
}
}

Reply all
Reply to author
Forward
0 new messages