var point = new Array(); function sample(){ for (s = 0; s < 11;s++ ){ point[s] = 0; } for (t = 1; t < 201; t++) { x1 = 0; for (s = 1; s < 11; s++) { if (Math.random() > 0.5) x1 = x1 + 1; } point[x1] = point[x1] + 1; } paint(); } function paint(){ var sub=new svgpaint(); str="<svg width=\"500\" height=\"500\">"; for(s=0;s<11;s++){ str=str+sub.rect(50*s,500-5*point[s],50,5*point[s],"blue"); } str=str+"</svg>"; $("#memo").html(str); }