Chart Now we have another example of Excel, and we all ask how to create a chart with ASP, and here's the solution <br><br>first we set the type of script<br> First set the script type <br><%@ language= "VBSCRIPT"%><br><br>make the object, and set the object to a Excelshee T<br> establishes ExcelSheet object <br><br>dim myexcelchart<br>set myexcelchart = CreateObject (" Excel.Sheet ") <BR><BR> ' show" or "dont" the Excel to user, true or false<br> let the user see the Excel table, true or false <BR> MyExcelChart.Application.Visible = True<br><br> ' Populate the Cells<br> add Excel table <BR> MyExcelChart.ActiveSheet.Range ("B2:k2"). Value = Array ("Week1", "Week2", "Week3", "Week4", "Week5", "Week6", "Week7", "Week8", "Week9", "Week10") <br>myexcel Chart.ActiveSheet.Range ("B3:k3"). Value = Array ("", "5", "9", "7", "" "," "," "," "", "") <br>myexcelchart.activesheet.range ("B4:k4"). Value = Array ("Ten", "Ten", "8", "" "," "," "," "," "," "," "Ten", "Ten") <br>myexcelchart.activesheet.range ("B5:k5") . VaLue = Array ("A", "3", "The", "", "", "", "" 5 "," 1 "," "", "") <br>myexcelchart.activesheet.cells (3,1). Value= "Internet Explorer" <br>myexcelchart.activesheet.cells (4,1). Value= "Netscape" <br>myexcelchart.activesheet.cells (5,1). Value= "Other" <BR><BR> "select" The contents "need" and "" "chart<br>" select the data to display in the chart (chart) in the Excel table <br>myexcelchart.activesheet.range ("B2:k5"). Select<br><br> ' Add The chart<br> Load Chart (chart) <BR>MyExcelChart.Charts.Add<BR> ' Format The chart, set type of chart, shape of the bars, show title, get the "data for the" chart, show DataTable, show legend<br > Initialization Chart (CHART), set chart type, bar chart shape, caption to display, get data to be plotted, display datasheet, display chart <br>myexcelchart.activechart.charttype = 97<br >myexcelchart.activechart.barshape =3<br>myexcelchart.activechart.hastitle = True<BR> MyExcelChart.activechart.ChartTitle.Text = "Visitors log for each week shown in browsers percentage" <BR> Myexcelchart.activechart.sEtsourcedata myexcelchart.sheets ("Sheet1"). Range ("A1:k5"), 1<br>myexcelchart.activechart.location 1<br>myexcelchart.activechart.hasdatatable = True<br>myexcelchart.activechart.datatable.showlegendkey = True<br><br> ' Save the ExcelSheet to Excelface<br> into Excel table <br>myexcelchart.saveas "C:\chart.xls" <br>%><br><br>now Lets complete the HTML tags.<br> below is the HTML code <BR><BR><HTML><BR><HEAD><BR> <TITLE>MyExcelChart</TITLE><BR></HEAD><BR><BODY><BR></BODY> <br>
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