您的位置:首页 >> 编程开发 >> .NET >> 其它 >> 正文
RSS
 

用VML技术实现统计图形的绘制(考试系统中的试卷分析模块)

http://www.rdxx.com 04年08月06日 12:12 Blog 我要投稿

关键词: 图形 , 统计 , 试卷 , 绘制 , Vml , 考试 , 系统 , 技术

这个地方我们用VML来显示试卷的难度系数的波动曲线图

下面是本页面的全部代码

 

<!--#include file="../conn.asp"-->
<!--#include file="function.asp"-->
<!--#include file="checksession.asp"-->
<%
papername=requeststr("papername")'这个是我自己写的函数,相当于request.from()
address=requeststr("class")
%>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title><%=papername&address&"试卷分析报告"%></title>
<script language="JavaScript">
self.moveTo(10,0)
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<LINK href="../css/body.css" rel=stylesheet type=text/css>
<STYLE>
 v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<script>
function drawLines()
{
 var count=0;//画横坐标
 for(var i=0;i<=60;i++){
    var px=200+73*i;
    var newLine = document.createElement("<v:line from='"+px+" 200' to='"+px+" 3200' style='position:absolute;z-index:7'></v:line>");
    group1.insertBefore(newLine);
    if(count%5!=0){
     var newStroke = document.createElement("<v:stroke dashstyle='dot' color='black'/>");
     newLine.insertBefore(newStroke);
 }
 else
 {
     var newStroke = document.createElement("<v:stroke color='#babbae'>");
     newLine.insertBefore(newStroke);
 }
 count++;
 }
 count=0; //画纵坐标
 for(var i=0;i<=50;i++){
    var py=3200-50*i;
    var newLine = document.createElement("<v:line from='200 "+py+"' to='4650 "+py+"' style='position:absolute;z-index:7'></v:line>");
    group1.insertBefore(newLine);
 if(count%5!=0){
     var newStroke = document.createElement("<v:stroke dashstyle='dot' color='black'/>");
     newLine.insertBefore(newStroke);
 }
 else
 {
     var newStroke = document.createElement("<v:stroke color='#babbae' />");
     newLine.insertBefore(newStroke); 
 } 
 count++;
 }
for (var j=1;j<=10;j++)
{
    var h=200+j*430;
    var newLine = document.createElement("<v:line from='"+h+" 2450' to='"+h+" 2700' style='position:absolute;z-index:7'></v:line>");
    group2.insertBefore(newLine);

}
for (var k=1;k<=10;k++)
{
    var h=2650-k*200;
    var newLine = document.createElement("<v:line from='200 "+h+"' to='250 "+h+"' style='position:absolute;z-index:7'></v:line>");
    group2.insertBefore(newLine);

}
}
function drawBar(v,t)
{
if(v==0)
v=1
  var h1=v*50-50;
  var px1=2500-v*50;
  var py1=260+t*440;
  var newShape= document.createElement("<v:rect style='position:absolute;left:"+py1+";top:"+px1+";WIDTH:190px;HEIGHT:"+h1+"px;z-index:9' coordsize='21600,21600' fillcolor='blue'></v:rect>")   

9 7 3 1 2 3 4 5 6 7 8 9 10 4 8 :

 
 
标签: 图形 , 统计 , 试卷 , 绘制 , Vml , 考试 , 系统 , 技术 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站