function updateHeatmap(data) {
return function(event) {
var map = event.chart;
if ( map.dataGenerated )
return;
if ( map.dataProvider.areas.length === 0 ) {
setTimeout( updateHeatmap, 100 );
return;
}
for ( var i = 0; i < map.dataProvider.areas.length; i++ ) {
map.dataProvider.areas[ i ].value = Math.round( Math.random() * 10000 );
}
map.dataGenerated = true;
map.validateNow();
}
}
// "method": updateHeatmap(data)