WebRoot/FusionChartsFree/Code/ASP/DB_JS/Default.asp

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<%@ Language=VBScript %>
<HTML>
<HEAD>	
	<TITLE>
	FusionCharts Free - Client Side Dynamic Chart ( using Database) Example
	</TITLE>
	
	<%
	'We've included ../Includes/FusionCharts.asp, which contains functions
	'to help us easily embed the charts.	
	%>
	<!-- #INCLUDE FILE="../Includes/FusionCharts.asp" -->
	<!-- #INCLUDE FILE="../Includes/DBConn.asp" -->
	
	<%
	'In this example, we show a combination of database + JavaScript rendering using FusionCharts.
	
	'The entire app (page) can be summarized as under. This app shows the break-down
	'of factory wise output generated. In a pie chart, we first show the sum of quantity
	'generated by each factory. These pie slices, when clicked would show detailed date-wise
	'output of that factory.
	
	'The XML data for the pie chart is fully created in ASP at run-time. ASP interacts
	'with the database and creates the XML for this.
	'Now, for the column chart (date-wise output report), we do not submit request to the server.
	'Instead we store the data for the factories in JavaScript arrays. These JavaScript
	'arrays are rendered by our ASP Code (at run-time). We also have a few defined JavaScript
	'functions which react to the click event of pie slice.
	
	'We've used an Access database which is present in ../DB/FactoryDB.mdb. 
	'It just contains two tables, which are linked to each other. 
	
	'Before the page is rendered, we need to connect to the database and get the
	'data, as we'll need to convert this data into JavaScript variables.
	
	'The following string will contain the JS Data and variables.
	'This string will be built in ASP and rendered at run-time as JavaScript.
	Dim jsVarString
	jsVarString = ""
	
	'Database Objects
	Dim oRs, oRs2, strQuery, indexCount
	indexCount = 0
	
	'Create the recordset to retrieve data
	Set oRs = Server.CreateObject("ADODB.Recordset")

	'Iterate through each factory
	strQuery = "select * from Factory_Master"
	Set oRs = oConn.Execute(strQuery)
	
	While not oRs.EOF
		indexCount = indexCount + 1
		
		'Create JavaScript code to add sub-array to data array
		'data is an array defined in JavaScript (see below)
		'We've added vbTab & vbCRLF to data so that if you View Source of the
		'output HTML, it will appear properly. It helps during debugging
		jsVarString = jsVarString & vbTab & vbTab & "data[" & indexCount & "] = new Array();" & vbCRLF
		
后面还有 148 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。