% '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. %>