var point = new Array(); function sample(){ for(sx=1;sx<501;sx++){ r1 = 0; for(s=1;s<61;s++){ r1=r1+Math.random(); } point[sx] = r1 - 30; } paint(); } function paint(){ var sub=new svgpaint(); str="<svg width=\"500\" height=\"500\">"; str=str+sub.rect(0,0,500,500,"blue"); for(s=1;s<501;s++){ str=str+sub.rect(s,250-10*point[s],3,3,"red"); } str=str+"</svg>"; $("#memo").html(str); }