You are viewing documentation for an older version. For current documentation - click here.

Throughout this section, we've shown you how to build charts using static data (i.e., data which was manually created by you). However, FusionCharts can also connect to dynamic sources of data using server side scripts like ASP, ASP.NET C#, ASP.NET VB.NET, PHP, J2EE, Ruby on Rails, ColdFusion etc.

FusionCharts can be implemented using ANY server-side technology, since charts are rendered at client side. The role of server-side scripts is only to provide XML/JSON data as string.

To make the task of embedding charts in web pages easier, FusionCharts provides wrapper classes for various server-side scripts like ASP, ASP.NET C#, ASP.NET VB.NET, PHP, J2EE, Ruby on Rails and ColdFusion. Moreover, in ASP and PHP, the APIs allow you to connect to arrays and databases and even dynamically build XML data which can directly be provided to chart.

In this page, we provide highlights of code snippets that are used in various server-side technologies for embedding FusionCharts. The next section shows how charts can be generated using dynamic data from database.

Using ASP
Call renderChart("../../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", 600, 300, False, True)

Read more from here on FusionCharts and ASP. For more details read the sections Using with ASP and FusionCharts ASP Class under the section Guide for Web Developers.

Using ASP.NET C#
FusionCharts.RenderChart("../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", "600", "300", false, true);

Read more from here on FusionCharts and ASP.NET C#. For more details read the sections Using with C# (ASP.NET) under Guide for Web Developers.

Using ASP.NET VB
FusionCharts.RenderChart("../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", "600", "300", False, True)

Read more from here on FusionCharts and ASP.NET VB. For more details read the section Using with VB.NET (ASP.NET) under Guide for Web Developers.

Using PHP
renderChart("../../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", 600, 300, false, true);

Read more from here on FusionCharts and PHP. For more details read Using with PHP and FusionCharts PHP Class sections under Guide for Web Developers.

Using J2EE
<jsp:include page="../Includes/FusionChartsRenderer.jsp" flush="true">
     <jsp:param name="chartSWF" value="../../FusionCharts/Column3D.swf" />
     <jsp:param name="strURL" value="Data/Data.xml" />
     <jsp:param name="strXML" value="" />
     <jsp:param name="chartId" value="myFirst" />
     <jsp:param name="chartWidth" value="600" />
     <jsp:param name="chartHeight" value="300" />
     <jsp:param name="debugMode" value="false" />
     <jsp:param name="registerWithJS" value="true" />
</jsp:include>

Read more from here on FusionCharts and J2EE. For more details read Using with J2EE section under Guide for Web Developers.

Using ColdFusion
<cfoutput>#renderChart("../../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", 600, 300, false, true)#</cfoutput>

Read more from here on FusionCharts and ColdFusion. For more details read Using with ColdFusion section under Guide for Web Developers.

Using Ruby on Rails
render_chart '/FusionCharts/Column3D.swf', 'Data/Data.xml', '', 'configuredChart', 600, 300, false, true 

Read more from here on FusionCharts and RoR. For more details read Using with RoR section under Guide for Web Developers.

Apart from embedding chart in web applications, some of the server-side-scripts also help in exporting the chart into image/pdf. You can know more on this from Exporting as Image/PDF > Server Side Exporting section. For scripts that do not support server side exporting, you can always use the client side Export handlers.