以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  跟别人学的呵呵!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=33760)


--  作者:wangjianredfox
--  发布时间:6/3/2006 6:14:00 PM

--  跟别人学的呵呵!
同学让我做个统计表,仿照别人的用svg做了一个,呵呵,挺有意思,

看了不要见笑啊!!!


--  作者:wangjianredfox
--  发布时间:6/3/2006 6:25:00 PM

--  
我没上传成功是不........


哎,自己写吧
数据
100,3006
150,2287
200,3616
250,1331
300,1843
350,1147
400,2211
450,2304
500,2764
550,2815
600,3931
650,2662
700,3583
750,1536


svg
200,199.4
250,271.3
300,138.4
350,366.9
400,315.7
450,385.3
500,278.9
550,269.6
600,223.6
650,218.5
700,106.9
750,233.8
800,141.7

850,346.4
我忘了数据坐标转换公式,所以只好一个一个算了
看吧
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="1000" height="1000" xmlns="http://www.w3.org/2000/svg"
                      xmlns:xlink="http://www.w3.org/1999/xlink">

<script type="text/javascript">
<![CDATA[
  var redVal=0;
  var greenVal=0;
  var blueVal=0;

function setColor(evt)
{
var target=evt.getTarget();
redVal=Math.round(Math.random()*255);
greenVal=Math.round(Math.random()*255);
blueVal=Math.round(Math.random()*255);
target.setAttribute("fill","rgb("+redVal+","+greenVal+","+blueVal+")");
}
]]>
</script>
<g>
<line x1="100" y1="100" x2="100" y2="500" stroke="rgb(0,255,0)"/>
<line x1="100" y1="500" x2="900" y2="500" stroke="rgb(0,255,0)"/>
<text x="500" y="50" text-anchor="end" onclick="setColor(evt)">Send a gift for a  Beautiful MM</text>
<text x="98" y="205" text-anchor="end" onclick="setColor(evt)">  3000 </text>
<text x="98" y="305" text-anchor="end" onclick="setColor(evt)">  2000 </text>
<text x="98" y="405" text-anchor="end" onclick="setColor(evt)">  1000 </text>
<text x="98" y="105" text-anchor="end" onclick="setColor(evt)">4000</text>
<text x="90" y="130" text-anchor="end" onclick="setColor(evt)">Enzyme-Live</text>
<text x="98" y="505" text-anchor="end" onclick="setColor(evt)">0</text>
<text x="705" y="510" text-anchor="end" onclick="setColor(evt)">600</text>
<text x="505" y="510" text-anchor="end" onclick="setColor(evt)">400</text>
<text x="305" y="510" text-anchor="end" onclick="setColor(evt)">200</text>
<text x="905" y="510" text-anchor="end" onclick="setColor(evt)">800 </text>
<text x="900" y="535" text-anchor="end" onclick="setColor(evt)">Dilution-Multiplier</text>

<circle cx="200" cy="199.4" r="1.5" onclick="setColor(evt)"/>
<circle cx="250" cy="271.3" r="1.5" onclick="setColor(evt)"/>
<circle cx="300," cy="138.4" r="1.5" onclick="setColor(evt)"/>
<circle cx="350" cy="366.9" r="1.5" onclick="setColor(evt)"/>
<circle cx="400," cy="315.7" r="1.5" onclick="setColor(evt)"/>
<circle cx="450" cy="385.3" r="1.5" onclick="setColor(evt)"/>
<circle cx="500" cy="278.9" r="1.5" onclick="setColor(evt)"/>
<circle cx="550" cy="269.6" r="1.5" onclick="setColor(evt)"/>
<circle cx="600" cy="223.6" r="1.5" onclick="setColor(evt)"/>
<circle cx="650" cy="218.5" r="1.5" onclick="setColor(evt)"/>
<circle cx="700" cy="106.9" r="1.5" onclick="setColor(evt)"/>
<circle cx="750" cy="233.8" r="1.5" onclick="setColor(evt)"/>
<circle cx="800" cy="141.7" r="1.5" onclick="setColor(evt)"/>
<circle cx="850" cy="346.4" r="1.5" onclick="setColor(evt)"/>
<defs>
<polyline id="polyline" points="97,107 100,100 103,107" />
</defs>
<use xlink:href="#polyline" onclick="setColor(evt)"/>
<use xlink:href="#polyline" transform="translate(1000,400) rotate(90)" onclick="setColor(evt)" />
</g>

</svg>


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
93.750ms