ASP implements a line chart (online)

Source: Internet
Author: User
Tags rowcount
You can consider using mschart, but the disadvantage is that the display is not very nice and not very professional. At the same time, it is troublesome if the client is not installed, because it cannot be displayed, therefore, most websites generate images. The following are some mschart items that can be used by myself. I have not used any other controls, so I cannot give you a satisfactory answer. In addition, I have a website www.tjinfo.com, which contains a survey question. mschart is used, but no line is used. You can define it yourself. mschart is also used in csdn surveys.
========================================================== ======================================
Looking at my summary, you will benefit a lot!
Mschart instructions

Mschart is a powerful chart tool created by Microsoft. It allows you to easily create various charts. Create a variety of 3-dimensional and 2-dimensional histograms and line charts. Based on my previous understanding of the mschart component, let's talk about how to use the mschart component.
1. Chart ActiveX Control:
In the HTML page, insert an <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.
Note: 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 shoshould 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.
Because 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:
<Object classid = "" CLSID: 5220cb21-c88d-11cf-b347-00aa00a28331 ""
Id = "" microsoft_licensed_class_manager_1_0 "">
<Param name = "" lpkpath "" value = "" mschart. LPK "">
</Object>
Insert the <Object> tag for your licensed control afterward. For example, an HTML page that displays the Microsoft Masked Edit Control looks like this.
Here I downloaded the file mschart. cab from Microsoft's website. It has been digitally signed.
<Object classid = "" CLSID: 3a2b370c-ba0a-11d1-b137-109f8753f5d ""
Id = mschart1 style = "" height: 326px; width: 651px "" codebase = "" mschart. Cab "> </Object>
You can look this acticle if you need help.
Http://support.microsoft.com/support/kb/articles/Q159/9/23.ASP
2. Introduction to some common attributes of the mschart component
A. charttype: Image Type
Charttype = 0> 3D Histogram
Charttype = 1> Two-Dimensional Histogram
Charttype = 2> three-dimensional line chart
Charttype = 3> two-dimensional line chart
Charttype = 4> 3D Area Chart
Charttype = 5> two-dimensional Area Chart
Charttype = 14> pie chart
B. showlegend: whether to display comments
C. titletext: Title
D. columncount: the number of data Columns
E. rowcount: the number of data rows
F, footnotetext: The footnote text.
G, plot: returns a reference to a plot object that describes the area upon which a chart is displayed.
H. Row: a row number in the current column. rows are numbered from top to bottom beginning with 1. Column: the current data column.
I. 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.
J. 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.
K. chartdata: A two-dimen1_array that holds the data used to draw the chart. if the first series of a Multi-dimenstmarray contains strings, those strings will become the labels of the chart. chartdata is the default property for the mschart control.
It is so empty 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.
Example 1: It come from:
Http://www.4guysfromrolla.com/webtech/MSChartExample.shtm
<Object classid = "" CLSID: 5220cb21-c88d-11cf-b347-00aa00a28331 ""
Id = "" microsoft_licensed_class_manager_1_0 "">
<Param name = "" lpkpath "" value = "" mschart. LPK "">
</Object>
<Object classid = "" CLSID: 3a2b370c-ba0a-11d1-b137-109f8753f5d ""
Id = mschart1 style = "" height: 326px; width: 651px "" codebase = "" mschart. Cab "> </Object>
<Script language = "" VBScript "">
Mschart1.charttype = 1
Mschart1.plot. seriescollection (1). Pen. vtcolor. Set 0, 0
Mschart1.plot. seriescollection (1). Pen. width = 50
For I = 1 to mschart1.plot. axis (1). Labels. Count
Mschart1.plot. axis (1). Labels (I). format = "" $0 ,###""
Mschart1.plot. axis (1). Labels (I). vtfont. Name = "" tahoma ""
Mschart1.plot. axis (1). Labels (I). vtfont. size = 10
Next
Mschart1.rowcount = 5
Mschart1.columncount = 2
Mschart1.showlegend = true
For y = 1 to 2
For x = 1 to 5
Mschart1.row = x
Mschart1.column = y
Mschart1.rowlabel = "" row "" & X
Call mschart1.datagrid. setdata (x, 1, x * 5, nullflag)
Call mschart1.datagrid. setdata (x, 2, x * 10, nullflag)
Next
Mschart1.columnlable = y
Next
</SCRIPT>
Example 2: We almost can see it everywhere.
<HTML>
<Head>
<Meta name = "" generator "" content = "" Microsoft Visual Studio 6.0 ">
<SCRIPT id = clienteventhandlersjs Language = JavaScript>
<! --
Function window_onload ()
{
T = 0;
Mschart1.titletext = "" title "";
Mschart1.showlegend = true;
Mschart1.columncount = 2;
Mschart1.rowcount = 3;
For (I = 0; I <3; I ++)
{For (j = 0; j <2; j ++)
{Mschart1.row = I + 1;
Mschart1.column = J + 1;
If (2> 1)
Mschart1.columnlabel = Document. form1.cname (j). value;
Else
Mschart1.columnlabel = Document. form1.cname. value;
If (document. form1.rcount. Value * Document. form1.ccount. Value)> 1)
Mschart1.data = Document. form1.rc _ data (T). value;
Else
Mschart1.data = Document. form1.rc _ data. value;
T ++;
}
If (document. form1.rcount. value> 1)
Mschart1.rowlabel = Document. form1.rname (I). value;
Else
Mschart1.rowlabel = Document. form1.rname. value;
}
}
Function select1_onchange (){
Mschart1.charttype = select1.value
Mschart1.plot
}
// -->
</SCRIPT>
<Title> data display chart </title>
</Head>
<Body Language = JavaScript onload = "" Return window_onload () ">
<Object classid = "" CLSID: 5220cb21-c88d-11cf-b347-00aa00a28331 ""
Id = "" microsoft_licensed_class_manager_1_0 "">
<Param name = "" lpkpath "" value = "" mschart. LPK "">
</Object>
<Object classid = "" CLSID: 3a2b370c-ba0a-11d1-b137-109f8753f5d ""
Id = mschart1 style = "" height: 326px; width: 651px "" codebase = "" mschart. Cab "> </Object>
<Br>
Display Mode
<Select id = select1 name = select1 Language = JavaScript onchange = "" Return select1_onchange () ">
<Option value = 1> Two-Dimensional Histogram </option>
<Option value = 0> three-dimensional histogram </option>
<Option value = 3> two-dimensional line chart </option>
<Option value = 2> three-dimensional line chart </option>
<Option value = 5> two-dimensional Area Chart </option>
<Option value = 4> 3D Area Chart </option>
<Option value = 14> pie chart </option> </SELECT>
<!
Chtitle Title
Rcount Columns
Number of ccount rows
Rc_type arrangement (1 in rows and 2 in columns)
Rc_data
Array of rname column names
Cname row name array>
<Form name = form1 id = form1>
<Input type = "" hidden "" name = rname id = rname value = 1993>
<Input type = "" hidden "" name = rname id = rname value = 1996>
<Input type = "" hidden "" name = rname id = rname value = 1999>
<Input type = "" hidden "" name = cname id = cname value = height>
<Input type = "" hidden "" name = cname id = cname value = weight>
<Input type = "" hidden "" name = rcount id = rcount value = 3>
<Input type = "" hidden "" name = chtitle id = chtitle value = coolfatman Growth Course>
<Input type = "" hidden "" name = ccount id = ccount value = 2>
<Input type = "" hidden "" name = rc_data id = rc_data value = 179>
<Input type = "" hidden "" name = rc_data id = rc_data value = 160>
<Input type = "" hidden "" name = rc_data id = rc_data value = 180>
<Input type = "" hidden "" name = rc_data id = rc_data value = 170>
<Input type = "" hidden "" name = rc_data id = rc_data value = 182>
<Input type = "" hidden "" name = rc_data id = rc_data value = 182>
</Form> </body>

 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.