300分求teechart在asp中的例子,我手头上有LPNG.DLL和TEECHART.OCX (300分)

  • 主题发起人 主题发起人 llk
  • 开始时间 开始时间
L

llk

Unregistered / Unconfirmed
GUEST, unregistred user!
300分求teechart在asp中的例子,要有连库,取数据,及详细参数的设置,
我要做的图表参数都是活的,最好有中文注解,或有中文文档,
我手头上有LPNG.DLL和TEECHART.OCX
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
year1=request("nd")
month1=request("yd")
week1=request("zhou")
if len(month1)=1 then
month1="0" &amp;
month1
end if
dim tj
tj="where nian='" &amp;
year1 &amp;
"' and yue='" &amp;
month1 &amp;
"' and zhou='" &amp;
week1 &amp;
"'"
set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "dfdl","sa","gjfd"
SQL="SELECT * FROM zhou_fdl " &amp;
tj
Set RS=Conn.Execute(SQL)
if rs.eof then
response.write "无本周的报表!"
else
Set CurChart= server.CreateObject("TeeChart.TChart")
set fso=server.createobject("scripting.filesystemobject")
CurChart.RemoveAllSeries
CurChart.Width = 700
CurChart.Height = 300
CurChart.Header.Text.Clear
CurChart.Header.Text.Add("周发电量图表")
CurChart.Header.Font.Color=RGB(255,0,0)
CurChart.Header.Font.Size=10
'CurChart.Footer.Text.Clear
'CurChart.Footer.Text.Add("发电厂")
'CurChart.Footer.Font.Color=RGB(255,255,255)
'CurChart.Footer.Font.Size=10
' 设置横坐标刻度
CurChart.Axis.Bottom.Labels.Font.Color=RGB(255,255,255)
CurChart.Axis.Bottom.Labels.Font.Bold=True
CurChart.Axis.Bottom.Labels.Font.Size=11
' 设置纵坐标标题
CurChart.Axis.Left.Title.Caption="亿度"
CurChart.Axis.Left.Title.Font.Color=RGB(255,255,0)
CurChart.Axis.Left.Title.Font.Size=15
' 设置纵坐标刻度
CurChart.Axis.Left.Labels.Font.Color=RGB(255,255,0)
CurChart.Axis.Left.Labels.Font.Bold=True
CurChart.Axis.Left.Labels.Font.Size=10

' 指定各系列的提示位置
CurChart.Legend.
Alignment=1
' 设置图形背景
CurChart.Panel.Gradient.Visible=True
CurChart.Panel.Gradient.StartColor=&amp;HEE2922
CurChart.Panel.Gradient.EndColor=&amp;HFFFF99
' 设置三维效果
CurChart.Walls.Left.Size=6
CurChart.Walls.Bottom.Size=6
CurChart.Aspect.Chart3DPercent=30
CurChart.Aspect.View3D =true
ChartType =1 '1 is 输出柱状图
curchart.legend.
Visible=true
CurChart.AddSeries(ChartType)
CurChart.Series(0).title="月计划"
CurChart.Series(0).Add rs("yg_yjh"),"阳光",&amp;HFFFFFF
CurChart.Series(0).Add rs("hd_yjh"),"河电",&amp;HFFFFFF
CurChart.Series(0).Add rs("ld_yjh"),"柳电",&amp;HFFFFFF
CurChart.Series(0).Add rs("dr_yjh"),"大热",&amp;HFFFFFF
CurChart.Series(0).Add rs("tq_yjh"),"天桥",&amp;HFFFFFF
CurChart.Series(0).Add rs("ts_yjh"),"天石",&amp;HFFFFFF
CurChart.Series(0).Marks.Style=smsValue
CurChart.Series(0).Marks.Visible=False
CurChart.Series(0).ColorEachPoint = False
CurChart.AddSeries(ChartType)
CurChart.Series(1).title="周计划"

CurChart.Series(1).Add rs("yg_zjh"),"阳光", clTeeColor
CurChart.Series(1).Add rs("hd_zjh"),"河电", clTeeColor
CurChart.Series(1).Add rs("ld_zjh"),"柳电", clTeeColor
CurChart.Series(1).Add rs("dr_zjh"),"大热", clTeeColor
CurChart.Series(1).Add rs("tq_zjh"),"天桥", clTeeColor
CurChart.Series(1).Add rs("ts_zjh"),"天石", clTeeColor
CurChart.Series(1).Marks.Style=smsValue
CurChart.Series(1).Marks.Visible=False
CurChart.Series(1).ColorEachPoint = False
CurChart.AddSeries(ChartType)
CurChart.Series(2).title="周实际"

CurChart.Series(2).Add rs("yg_zsj"),"阳光", clTeeColor
CurChart.Series(2).Add rs("hd_zsj"),"河电", clTeeColor
CurChart.Series(2).Add rs("ld_zsj"),"柳电", clTeeColor
CurChart.Series(2).Add rs("dr_zsj"),"大热", clTeeColor
CurChart.Series(2).Add rs("tq_zsj"),"天桥", clTeeColor
CurChart.Series(2).Add rs("ts_zsj"),"天石", clTeeColor
CurChart.Series(2).Marks.Style=smsValue
CurChart.Series(2).Marks.Visible=False
CurChart.Series(2).ColorEachPoint = False
CurChart.AddSeries(ChartType)
CurChart.Series(3).title="差别"
CurChart.Series(3).Add rs("yg_cb"),"阳光", clTeeColor
CurChart.Series(3).Add rs("hd_cb"),"河电", clTeeColor
CurChart.Series(3).Add rs("ld_cb"),"柳电", clTeeColor
CurChart.Series(3).Add rs("dr_cb"),"大热", clTeeColor
CurChart.Series(3).Add rs("tq_cb"),"天桥", clTeeColor
CurChart.Series(3).Add rs("ts_cb"),"天石", clTeeColor
CurChart.Series(3).Marks.Style=smsValue
CurChart.Series(3).Marks.Visible=False
CurChart.Series(3).ColorEachPoint = False
' 把图形文件名转化成本地绝对路径表达方式
JpegLocalFile = Server.Mappath( "char_zfd.jpg" )
CurChart.Export.SaveToJPEGFile JpegLocalFile, False, jpegBestQuality, 92,CurChart.Width, CurChart.Height
Set CurChart = Nothing
%>
<div align="center">
<center>
<table border="0" width="100%">
<tr>
<td width="100%" colspan="2"> <p align="center">
<% Response.Write("<img src=char_zfd.jpg align='center'>") %>
</td>
</tr>
<tr>
<td width="90">&amp;nbsp;</td>
<td>
<table width="600" border="1" align="left" cellpadding="0" cellspacing="0">
<tr>
<td>&amp;nbsp;</td>
<td width="13%">阳光</td>
<td width="13%">河坡</td>
<td width="13%">柳电</td>
<td width="13%">大热</td>
<td width="13%">天桥</td>
<td width="13%">天石</td>
</tr>
<tr>
<%response.Write("<td>月计划</td>")
response.Write("<td width='13%'>" &amp;
rs("yg_yjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("hd_yjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ld_yjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("dr_yjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("tq_yjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ts_yjh") &amp;
"</td>")
response.Write("</tr>")
response.Write("<tr>")

response.Write("<td>周计划</td>")
response.Write("<td width='13%'>" &amp;
rs("yg_zjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("hd_zjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ld_zjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("dr_zjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("tq_zjh") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ts_zjh") &amp;
"</td>")
response.Write("</tr>")
response.Write("<tr>")

response.Write("<td>周实际</td>")
response.Write("<td width='13%'>" &amp;
rs("yg_zsj") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("hd_zsj") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ld_zsj") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("dr_zsj") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("tq_zsj") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ts_zsj") &amp;
"</td>")
response.Write("</tr>")
response.Write("<tr>")

response.Write("<td>与日历进度差</td>")
response.Write("<td width='13%'>" &amp;
rs("yg_cb") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("hd_cb") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ld_cb") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("dr_cb") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("tq_cb") &amp;
"</td>")
response.Write("<td width='13%'>" &amp;
rs("ts_cb") &amp;
"</td>")
response.Write("</tr>")
response.Write("</table>")
%>
</td>
</tr>
</table>
</center>
</div>
<%
end if
set rs=nothing
%>
</body>
</html>
 

<SCRIPT Language="VBScript" RUNAT=Server>
dim TChart1
Set TChart1 = Server.CreateObject("TeeChart.TChart")
TChart1.removeallseries
'设置标题
TChart1.Header.Text.Clear
TChart1.Header.Text.Add ("chart测试")
TChart1.Header.Font.Color=RGB(22,5,120)
'TChart1.Header.Font.Size=2  

'赋值
TChart1.AddSeries(1)
TChart1.Series(0).Clear
TChart1.Series(0).Add 100, "Apples", RGB(111,166,196)
TChart1.Series(0).Add 300, "Pears", RGB(101,122,205)
TChart1.Series(0).Add 200, "Bananas", RGB(255,255,0)

' 把图形文件名转化成本地绝对路径表达方式
JpegLocalFile = Server.Mappath( "pic.jpg" )
' 把制定的图形生成、存入本指定文件
TChart1.Export.SaveToJPEGFile JpegLocalFile, False, jpegBestQuality, 100,_
TChart1.Width, TChart1.Height
Response.Write("<img src=pic.jpg>")
</SCRIPT>
 
多人接受答案了。
 
后退
顶部