可以考虑使用MSCHART,但是缺点是显示不太好看,不很专业,同时,如果客户端没有装的话就比较麻烦,因为显示不出来,所以一般的网站都采用生成图片的方式。下面给出MSCHART的一些东西,可以自己考虑着使用,我没有使用过其他的控件,所以不能给你满意的答复。另外附给你一个网址,www.tjinfo.com,里面有个调查题,使用了MSCHART,但是没有用折线,这个你可以自己定义的,CSDN的调查也使用了MSCHART。
看看我的这篇总结,你会受益匪浅!
关于Mschart的说明文档
MsChart是微软制作的功能强大的图表工具,用它可以很方便的建立各种图表。制作各种3维2维的直方图,折线图。结合前一段时间我对Mschart组件的认识,谈谈Mschart组件的使用方法。
1、 Chart Activex控件:
In the HTML page, insert an
1<object> tag for the License Manager object before any other <object> tags. The License Manager is an ActiveX control that is installed with Internet Explorer.
2NOTE: This CLASSID, "5220cb21-c88d-11cf-b347-00aa00a28331", is for the License Manager and not for your ActiveX controls. You must use the same CLASSID every time you refer to the LPK file. In addition, you should keep the Name property of the <param/> tag as "LPKPath", and set the Value property for the <param/> tag of the License Manager object to the LPK file name and path. This path may be a relative path but must not refer to a UNC share or a URL on another domain.
3Because you can only have one LPK file for each HTML page, make sure that you include all of the licensed ActiveX Controls for the page when you generate your LPK file. For example:
4<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" id="Microsoft_Licensed_Class_Manager_1_0">
5<param name="LPKPath" value="mschart.lpk"/>
6</object>
7Insert the <object> tag for your licensed control afterward. For example, an HTML page that displays the Microsoft Masked Edit control looks like this.
8Here I downloaded the file mschart.cab from Microsoft's website. It has been digitally signed.
9<object classid="clsid:3A2B370C-BA0A-11D1-B137-0000F8753F5D" codebase="mschart.cab" id="mschart1" style="HEIGHT: 326px; WIDTH: 651px"></object>
10You can look this acticle if you need help.
11http://support.microsoft.com/support/kb/articles/Q159/9/23.ASP
122、 Mschart组件的一些常用属性介绍
13a、charttype:图形的类型
14charttype=0>三维直方图
15charttype=1>二维直方图
16charttype=2>三维折线图
17charttype=3>二维折线图
18charttype=4>三维面积图
19charttype=5>二维面积图
20charttype=14>饼图
21b、showlegend:是否显示解说
22c、titletext:标题
23d、Columncount: The number of data columns
24e、Rowcount:The number of data rows
25f、Footnotetext:The footnote text.
26g、Plot: Returns a reference to a Plot object that describes the area upon which a chart is displayed.
27h、row: A row number in the current column. Rows are numbered from top to bottom beginning with 1. column: The current data column.
28i、Rowlabel: The text for a row label. The label you specify sets the label for the data points identified by the Row property. This label appears along the category axis for most chart types and is used as the label for each individual pie in a pie chart. Label text may not be displayed if it is too long to fit on a chart.columnlabel: . Label text associated with a column in the data grid.
29j、Data: The data point value. If the current data point already contains a value, it is replaced by the new value. The chart is redrawn to reflect the new value for the current data point.
30k、ChartData: A two-dimensional array that holds the data used to draw the chart. If the first series of a multi-dimensional array contains strings, those strings will become the labels of the chart.ChartData is the default property for the MSChart control.
31It is so many properities about Mschart Activex.I only introduce so much.Now,I will provide your two example to you!I wish it can help you understand it.
32Example 1:It come from:
33http://www.4guysfromrolla.com/webtech/MSChartExample.shtm
34<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" id="Microsoft_Licensed_Class_Manager_1_0">
35<param name="LPKPath" value="mschart.lpk"/>
36</object>
37<object classid="clsid:3A2B370C-BA0A-11D1-B137-0000F8753F5D" codebase="mschart.cab" id="mschart1" style="HEIGHT: 326px; WIDTH: 651px"></object>
38<script language="Vbscript">
39MSChart1.ChartType =1
40MSChart1.Plot.SeriesCollection(1).Pen.VtColor.Set 0,0,0
41MSChart1.Plot.SeriesCollection(1).Pen.Width = 50
42For i = 1 To MSChart1.Plot.Axis(1).Labels.Count
43MSChart1.Plot.Axis(1).Labels(i).Format = "$0,###"
44MSChart1.Plot.Axis(1).Labels(i).VtFont.Name = "Tahoma"
45MSChart1.Plot.Axis(1).Labels(i).VtFont.Size = 10
46Next
47MSChart1.RowCount = 5
48MSChart1.ColumnCount =2
49MSChart1.ShowLegend = True
50for y = 1 to 2
51for x = 1 to 5
52MSChart1.Row = x
53MsChart1.Column= y
54MSChart1.RowLabel = "Row " & x
55call MSChart1.DataGrid.SetData(x, 1, x*5,nullFlag)
56call MSChart1.DataGrid.SetData(x, 2, x*10,nullFlag)
57next
58Mschart1.ColumnLable=y
59next
60</script>
61Example 2:We almost can see it everywhere.
62<html>
63<head>
64<meta content="Microsoft Visual Studio 6.0" name="GENERATOR"/>
65<script id="clientEventHandlersJS" language="javascript">
66<!--
67function window_onload()
68{
69t=0;
70mschart1.TitleText = "标题";
71mschart1.ShowLegend =true;
72mschart1.ColumnCount =2;
73mschart1.RowCount =3;
74for (i=0;i<3;i++)
75{for (j=0;j<2;j++)
76{ mschart1.Row=i+1;
77mschart1.Column=j+1;
78if (2>1)
79mschart1.ColumnLabel =document.form1.cname(j).value;
80else
81mschart1.ColumnLabel =document.form1.cname.value;
82if ((document.form1.rcount.value*document.form1.ccount.value)>1)
83mschart1.Data=document.form1.rc_data(t).value;
84else
85mschart1.Data=document.form1.rc_data.value;
86t++;
87}
88if (document.form1.rcount.value>1)
89mschart1.RowLabel =document.form1.rname(i).value ;
90else
91mschart1.RowLabel =document.form1.rname.value;
92}
93}
94function select1_onchange() {
95mschart1.chartType =select1.value
96mschart1.Plot
97}
98//-->
99</script>
100<title>数据显示图</title>
101</head>
102<body language="javascript" onload="return window_onload()">
103<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" id="Microsoft_Licensed_Class_Manager_1_0">
104<param name="LPKPath" value="mschart.lpk"/>
105</object>
106<object classid="clsid:3A2B370C-BA0A-11D1-B137-0000F8753F5D" codebase="mschart.cab" id="mschart1" style="HEIGHT: 326px; WIDTH: 651px"></object>
107<br/>
108显示方式
109<select id="select1" language="javascript" name="select1" onchange="return select1_onchange()">
110<option value="1">二维直方图</option>
111<option value="0">三维直方图</option>
112<option value="3">二维折线图</option>
113<option value="2">三维折线图</option>
114<option value="5">二维面积图</option>
115<option value="4">三维面积图</option>
116<option value="14">饼图</option></select>
117<!--
118chtitle 标题
119rcount 列数
120ccount 行数
121rc_type 排列方式(1 以行方式,2以列方式)
122rc_data 数据
123rname 列名数组
124cname 行名数组-->
125<form id="form1" name="form1">
126<input id="rname" name="rname" type="hidden" value="1993"/>
127<input id="rname" name="rname" type="hidden" value="1996"/>
128<input id="rname" name="rname" type="hidden" value="1999"/>
129<input id="cname" name="cname" type="hidden" value="身高"/>
130<input id="cname" name="cname" type="hidden" value="体重"/>
131<input id="rcount" name="rcount" type="hidden" value="3"/>
132<input id="chtitle" name="chtitle" type="hidden" value="CoolFatMan的成长里程"/>
133<input id="ccount" name="ccount" type="hidden" value="2"/>
134<input id="rc_data" name="rc_data" type="hidden" value="179"/>
135<input id="rc_data" name="rc_data" type="hidden" value="160"/>
136<input id="rc_data" name="rc_data" type="hidden" value="180"/>
137<input id="rc_data" name="rc_data" type="hidden" value="170"/>
138<input id="rc_data" name="rc_data" type="hidden" value="182"/>
139<input id="rc_data" name="rc_data" type="hidden" value="182"/>
140</form></body></html></object></object></object>