google.load("visualization", "1", {packages:["geochart"]});
var namex=new Array();
var number_dir=new Array();
var dir=new Array();
var x=new Array();
var a=new Array();
var fight;
var def;
var point=new Array();
function sample(){
for (s = 1; s < 48;s++ ){
dir[s]=new Array();
}
var sub = new ex();
sub.dir = dir;
sub.faststep();
dir = sub.dir;
namex = sub.namex;
number_dir = sub.number_dir;
for(s=0;s<48;s++){
x[s]=new Array();
point[s] = s;
}
x[0][0]="Region";
x[0][1]="POINT";
for(s=1;s<48;s++){
x[s][0]=namex[s];
}
var options = {
region: 'JP',
resolution: 'provinces',
colorAxis: {colors: ['green','yellow', 'red']}
};
var timer;
var delay = 1000;
var loop = function () {
n1 = 47 * Math.random();
fight = Math.floor(n1) + 1;
n1 = number_dir[fight] * Math.random();
n2 = Math.floor(n1) + 1;
def = dir[fight][n2];
g1 = point[fight];
g2 = point[def];
for (s = 1; s < 48;s++ ){
if(point[s]==g2)point[s]=g1;
}
for (s = 1; s < 48; s++) {
x[s][1] = point[s];
}
var data = google.visualization.arrayToDataTable(x);
var chart = new google.visualization.GeoChart(document.getElementById('memo'));
chart.draw(data, options);
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
最終更新:2015年11月01日 19:03