| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1101 人关注过本帖
标题:[求助]想问个有难度的问题!程序生成视图?
取消只看楼主 加入收藏
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
结帖率:66.67%
收藏
 问题点数:0 回复次数:4 
[求助]想问个有难度的问题!程序生成视图?

是不是没有程序可以生成像正弦或余弦函数那样的图啊!

图片附件: 游客没有浏览图片的权限,请 登录注册



还有是不是也没有办法生成这样的显示:
图片附件: 游客没有浏览图片的权限,请 登录注册



是不是这是二维系统啊!(我也不知道什么是二维系统!

关键是要两个值X、Y。怎么弄呢!
搜索更多相关主题的帖子: 视图 难度 
2006-10-09 13:07
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:0 

二楼的可以借鉴!

随便问一下!我如果想生成两条折线呢!

我遇到个程序。他有这样一些数据:

实际:10 20 30 45 65 45 62
计划:25 12 32 56 58 54 12

这是打个比方有这些个数据,我想生成像你给的那种折线图两条改怎么写呢!

我如果想用程序来写的话,我还没有看你这个页面的代码,相信可以用程序写的,等看了再回复吧!

再次谢谢各位的关心!

还有4楼的兄弟发的是什么啊!没有看懂!能解释一下吗!


程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2006-10-09 20:50
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:0 
以下是引用tang688在2006-10-9 23:24:00的发言:


如果想要这些图,可以调用OFFICE的控件的.EXCEL中都有

但是我是用ASP做网页啊!想在网页里面生成这样的表啊!

也可以按照您说的来处理吗!


程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2006-10-10 13:11
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:0 

我在网上找到一个这样的例子不知道可以这样做不?
<%
'┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
'┃                               ┃
'┃ 摘 要: 统计图--曲线图                    ┃
'┃ 作 者: 翁云兵                       ┃
'┃ 创建日期:2004年12月01日                   ┃
'┃ 完成日期:2004年11月03日                   ┃
'┃                               ┃
'┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
'参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,X轴单位,Y轴单位)
function table1(stat_array,table_left,table_top,all_width,all_height,table_title,X_unit,Y_unit)
dim bg_color(10)
bg_color(1)="#ff1919"
bg_color(2)="#ffff19"
bg_color(3)="#1919ff"
bg_color(4)="#19ff19"
bg_color(5)="#fc0"
bg_color(6)="#3cc"
bg_color(7)="#ff19ff"
bg_color(8)="#993300"
bg_color(9)="#f60"
bg_color(10)="#ff8c19"

if X_unit <> "" then
X_unit = X_unit
end if
if Y_unit <> "" then
Y_unit = Y_unit
end if

num1 = ubound(stat_array,1)
line_temp=split(stat_array(0,1),",")
num2 = ubound(line_temp,1)+1
dim line_code
redim line_code(num1,num2)
for j=1 to num2
line_code(0,j) = line_temp(j-1)
next
for i=1 to num1
line_temp = split(stat_array(i,1),",")
line_code(i,0) = stat_array(i,2)
for j=1 to num2
line_code(i,j) = cdbl(line_temp(j-1))
next
next
value_Max=0
for i=1 to num1
for j=1 to num2
if value_Max<line_code(i,j) then value_Max=line_code(i,j)
next
next

value_Max = cint(value_Max)
value_Max_str =cstr(value_Max)
if value_Max>9 then
temp=mid(value_Max_str,2,1)
if temp>4 then
temp2=(int(value_Max/(10^(len(value_Max_str)-1)))+1)*10^(len(value_Max_str)-1)
else
temp2=(int(value_Max/(10^(len(value_Max_str)-1)))+0.5)*10^(len(value_Max_str)-1)
end if
else
if value_Max>4 then temp2=10 else temp2=5
end if
item_hight = temp2/5

item_width = 20000/(num2-1)

response.Write "<v:rect id='background' style='position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;' fillcolor='#EFEFEF' strokecolor='gray'>"
response.Write " <v:shadow on='t' type='single' color='silver' offset='4pt,4pt'/>"
response.Write "</v:rect>"

response.Write "<v:group ID='table' style='position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;' coordsize = '27500,12800'>"

response.Write " <v:Rect style='position:relative;left:1500;top:200;width:23000;height:800'filled='false' stroked='f'>"
response.Write " <v:TextBox inset='0pt,0pt,0pt,0pt'>"
response.Write " <table width='100%' border='0' align='center' cellspacing='0'>"
response.Write " <tr>"
response.Write " <td align='center' valign='middle'><div style='font-size:15pt; font-family:黑体;'><B>"&table_title&"</B></div></td>"
response.Write " </tr>"
response.Write " </table>"
response.Write " </v:TextBox>"
response.Write " </v:Rect> "

response.Write " <v:rect id='back' style='position:relative;left:1700;top:1200;width:20500; height:10500;' fillcolor='#9cf' strokecolor='#DFDFDF'>"
response.Write " <v:fill rotate='t' angle='-45' focus='100%' type='gradient'/>"
response.Write " </v:rect>"

response.Write " <v:rect id='back2' style='position:relative;left:23000;top:1200;width:4000; height:"&(10500)&";' fillcolor='#9cf' stroked='t' strokecolor='#0099ff'>"
response.Write " <v:fill rotate='t' angle='-175' focus='100%' type='gradient'/>"
response.Write " <v:shadow on='t' type='single' color='silver' offset='3pt,3pt'/>"
response.Write " </v:rect>"

for i=1 to num1
if i=1 then
displaystr=""
else
displaystr="none"
end if
response.Write " <div style='cursor:hand;' onmouseover='moveon(rec"&i&",line_"&i&")' onmouseout='moveout(rec"&i&",line_"&i&","&i&")' onclick='clickit("&i&")'>"
response.Write " <v:Rect id='rec"&i&"' style='position:relative;left:23100;top:"&(i-1)*10200/10+1450&";width:3800;height:800;display:"&displaystr&";' fillcolor='#efefef' strokecolor='"&bg_color(i)&"'>"
response.Write " <v:fill opacity='.6' color2='fill darken(118)' opacity2='.6' rotate='t' method='linear sigma' focus='100%' type='gradient'/>"
response.Write " </v:Rect>"
response.Write " <v:Rect style='position:relative;left:23200;top:"&(i-1)*10200/10+1500&";width:600;height:700' fillcolor='"&bg_color(i)&"' stroked='f'/>"
response.Write " <v:Rect style='position:relative;left:24000;top:"&(i-1)*10200/10+1500&";width:3400;height:700' filled='f' stroked='f'>"
response.Write " <v:TextBox inset='0pt,4pt,0pt,0pt' style='font-size:9pt;'><div align='left'>"&stat_array(i,2)&"</div></v:TextBox>"
response.Write " </v:Rect> "
response.Write " </div> "
next

response.Write " <v:line ID='X' from='1700,11700' to='22700,11700' style='z-index:2' strokecolor='#000000' strokeWeight=1pt><v:stroke EndArrow='Classic'/></v:line>"
response.Write " <v:line ID='Y' from='1700,900' to='1700,11700' style='z-index:2' strokecolor='#000000' strokeWeight=1pt><v:stroke StartArrow='Classic'/></v:line>"

response.Write " <v:Rect style='position:relative;left:100;top:700;width:1500;height:500' filled='false' stroked='false'>"
response.Write " <v:TextBox inset='0pt,0pt,0pt,0pt' style='font-size:9pt;'><div align='right'>"&Y_unit&"</div></v:TextBox>"
response.Write " </v:Rect> "
response.Write " <v:Rect style='position:relative;left:22200;top:11900;width:2000;height:500' filled='false' stroked='false'>"
response.Write " <v:TextBox inset='0pt,0pt,0pt,0pt' style='font-size:9pt;'><div align='left'>"&X_unit&"</div></v:TextBox>"
response.Write " </v:Rect> "

for i=0 to 4
response.Write " <v:line from='1300,"&i*2000+1700&"' to='1700,"&i*2000+1700&"' style='z-index:2' strokecolor='#000000'></v:line>"
response.Write " <v:line from='1700,"&i*2000+1700&"' to='2200,"&i*2000+1200&"' style='z-index:2' strokecolor='#0099FF'></v:line>"
response.Write " <v:line from='2200,"&i*2000+1200&"' to='22200,"&i*2000+1200&"' style='z-index:2' strokecolor='#0099FF'></v:line>"
response.Write " <v:line from='2200,"&i*2000+2200&"' to='22200,"&i*2000+2200&"' style='z-index:2' strokecolor='#0099FF'>"
response.Write " <v:stroke dashstyle='Dot'/>"
response.Write " </v:line>"

response.Write " <v:Rect style='position:relative;left:100;top:"&i*2000+1250&";width:1500;height:500' filled='false' stroked='false'>"
response.Write " <v:TextBox inset='0pt,0pt,0pt,0pt' style='font-size:9pt;'><div align='right'>"&item_hight*(5-i)&"</div></v:TextBox>"
response.Write " </v:Rect> "
next

response.Write " <v:line from='2200,11200' to='22200,11200' style='z-index:2' strokecolor='#0099FF'></v:line>"
response.Write " <v:line from='2200,1200' to='2200,11200' style='z-index:2' strokecolor='#0099FF'></v:line>"
response.Write " <v:line from='1700,11700' to='2200,11200' style='z-index:2' strokecolor='#0099FF'></v:line>"

for j=0 to num2-1
response.Write " <v:line from='"&j*item_width+1700&",11700' to='"&j*item_width+1700&",12000' style='z-index:2' strokecolor='#000000'></v:line>"
response.Write " <v:line from='"&j*item_width+1700&",11700' to='"&j*item_width+2200&",11200' style='z-index:2' strokecolor='#0099FF'><v:stroke dashstyle='ShortDot'/></v:line>"
response.Write " <v:line from='"&j*item_width+2200&",1200' to='"&j*item_width+2200&",11200' style='z-index:2' strokecolor='#0099FF'><v:stroke dashstyle='ShortDot'/></v:line>"
response.Write " <v:Rect style='position:relative;left:"&j*item_width+1700-item_width/2&";top:12100;width:"&item_width&";height:500' filled='false' stroked='false'>"
response.Write " <v:TextBox inset='0pt,0pt,0pt,0pt' style='font-size:9pt;'><div align='center'>"&line_code(0,j+1)&"</div></v:TextBox>"
response.Write " </v:Rect> "
next
for i=1 to num1
if i=1 then
displaystr=""
else
displaystr="none"
end if
response.Write " <div id='line_"&i&"' style='display:"&displaystr&";'>"
for j=0 to num2-2
this_hight1 = cint(line_code(i,j+1)/(5*item_hight)*10000)
this_hight2 = cint(line_code(i,j+2)/(5*item_hight)*10000)
'线条样式
response.Write " <v:line from='"&j*item_width+1850&","&(10000-this_hight1+1550)&"' to='"&(j+1)*item_width+1850&","&(10000-this_hight2+1550)&"'style='z-index:"&i*10&";' strokeweight='0.1pt' strokecolor='"&bg_color(i)&"'>"
response.Write " <extrusion v:ext='view' backdepth='2pt' on='t' lightposition='-50000,-50000' lightposition2='50000'/>"
response.Write " </v:line>"
next
response.Write " </div>"
next

response.Write "</v:group>"
end function
%>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
<STYLE>
v\:* { Behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
var showit = new Array(10);

function moveon(iteam,lineit){
temp=eval(iteam)
templine=eval(lineit)
if(showit[1]){
rec1.style.display = "";
line_1.style.display = "";
}else{
rec1.style.display = "none";
line_1.style.display = "none";
}
temp.style.display = "";
templine.style.display = "";
}
function moveout(iteam,lineit,i){
temp=eval(iteam)
templine=eval(lineit)
if (showit[i]){
temp.style.display = "";
templine.style.display = "";
}else{
temp.style.display = "none";
templine.style.display = "none";
}
}
function clickit(i){
if (showit[i]){
showit[i]=false
}else{
showit[i]=true
}
}
-->
</script>
</head>
<body>

<p>
<%
dim total(10,2)

total(0,1)="1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月"
total(1,1)="200,158,982,0,369,100,595,895,652,25,245,951"
total(2,1)="984,58,495,36,158,486,952,258,653,415,485,14"
total(3,1)="850,988,958,145,369,745,265,158,856,145,425,352"
total(4,1)="600,525,235,485,258,265,158,365,35,148,658,475"
total(5,1)="62,525,635,215,0,465,258,305,66,547,54,148"
total(6,1)="560,625,645,329,158,665,358,95,120,358,42,253"
total(7,1)="950,725,635,435,258,865,458,955,152,845,425,421"
total(8,1)="600,825,155,455,458,265,558,365,352,245,853,122"
total(9,1)="360,925,215,545,658,465,658,845,400,421,541,125"
total(10,1)="50,225,355,655,858,665,758,35,584,214,54,651"

total(1,2)="项目1"
total(2,2)="项目2"
total(3,2)="项目3"
total(4,2)="项目4"
total(5,2)="项目5"
total(6,2)="项目6"
total(7,2)="项目7"
total(8,2)="项目8"
total(9,2)="项目9"
total(10,2)="项目10"


call table1(total,20,20,700,350,"曲 线 统 计 图","时间","元")
%>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p><br>
<br>

</body>
</html>


程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2006-10-12 08:34
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:0 

好象制作这样的图形用VML!
VML(Vector Markup Language)
是一个最初由Microsoft开发的XML词表,现在也只有IE5.0以上版本对VML提供支持。使用VML可以在IE中绘制矢量图形,所以有人认为VML就是在IE中实现了画笔的功能。下面介绍一下VML的优点:
基于XML标准
XML是公认拥有无穷生命力的下一代网络标记语言, VML具有先天的优势,它的表示方法简单,易于扩展等等。
支持高质量的矢量图形显示
VML支持广泛的矢量图形特征,它们基于由相连接的直线和曲线描述路径。在VML中使用两个基本的元素:shape和group。这两个元素定义了VML的全部结构;shape描述一个矢量图形元素,而group用来将这些图形结合起来,这样它们可以作为一个整体进行处理。
VML规范包括大量的支持多种不同矢量图形特征的元素。下面是VML的预定义图形元素:
l Shape
l Path
l Line
l Polyline
l Curve
l Rect
l Roundrect
l Oval
l Arc
l Group
由文本构成的图像,并可集成到HTML
由于VML使用简单的文本来表示图像,这样就可用很少的字节来表示比较复杂的图像。VML与HTML兼容,通过在HTML中声明VML命名空间并声明处理函数,就可以和其他HTML元素一样使用VML元素,在客户端浏览器显示图像。VML标记里面可以定义DHTML大部分属性和事件,比如说id, name, title, onmouseover 等等。
支持交互与动画
但VML的功能不只是绘图,他还可以在图形中嵌入文本,并可实现超链,还可通过脚本语言实现一定的动画功能。VML赏析


http://zhidao.baidu.com/question/5457981.html


程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2006-10-12 08:37
快速回复:[求助]想问个有难度的问题!程序生成视图?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020080 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved