WebRoot/FusionChartsFree/Code/ASP/Includes/FusionCharts.asp
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<%
'Page: FusionCharts.asp
'Author: InfoSoft Global (P) Ltd.
'This page contains functions that can be used to render FusionCharts.
'encodeDataURL function encodes the dataURL before it's served to FusionCharts.
'If you've parameters in your dataURL, you necessarily need to encode it.
'Param: strDataURL - dataURL to be fed to chart
'Param: addNoCacheStr - Whether to add aditional string to URL to disable caching of data
Function encodeDataURL(strDataURL, addNoCacheStr)
'Add the no-cache string if required
if addNoCacheStr=true then
'We add ?FCCurrTime=xxyyzz
'If the dataURL already contains a ?, we add &FCCurrTime=xxyyzz
'We replace : with _, as FusionCharts cannot handle : in URLs
if Instr(strDataURL,"?")<>0 then
strDataURL = strDataURL & "&FCCurrTime=" & Replace(Now(),":","_")
else
strDataURL = strDataURL & "?FCCurrTime=" & Replace(Now(),":","_")
end if
end if
'URL Encode it
encodeDataURL = Server.URLEncode(strDataURL)
End Function
'renderChart renders the JavaScript + HTML code required to embed a chart.
'This function assumes that you've already included the FusionCharts JavaScript class
'in your page.
' chartSWF - SWF File Name (and Path) of the chart which you intend to plot
' strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
' strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
' chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
' chartWidth - Intended width for the chart (in pixels)
' chartHeight - Intended height for the chart (in pixels)
Function renderChart(chartSWF, strURL, strXML, chartId, chartWidth, chartHeight)
'First we create a new DIV for each chart. We specify the name of DIV as "chartId"Div.
'DIV names are case-sensitive.
%>
<!-- START Script Block for Chart <%=chartId%> -->
<div id='<%=chartId%>Div' align='center'>
Chart.
<%
'The above text "Chart" is shown to users before the chart has started loading
'(if there is a lag in relaying SWF from server). This text is also shown to users
'who do not have Flash Player installed. You can configure it as per your needs.
%>
</div>
<%
'Now, we render the chart using FusionCharts Class. Each chart's instance (JavaScript) Id
'is named as chart_"chartId".
%>
<script type="text/javascript">
//Instantiate the Chart
var chart_<%=chartId%> = new FusionCharts("<%=chartSWF%>", "<%=chartId%>", "<%=chartWidth%>", "<%=chartHeight%>");
<%
'Check whether we've to provide data using dataXML method or dataURL method
if strXML="" then %>
//Set the dataURL of the chart
后面还有 57 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。