After you complete the initial setup, all you are left to do is - use the FusionCharts jsp tags to embed the chart in your jsp by providing the necessary attributes to it.
Steps to incorporate FusionCharts XT in your jsp:
- Three lines of code in jsp (no logic ) to embed the chart.
- Bean to provide the render data and data source for the chart.
Let's quickly see each of them.
Code in the jsp:
<%@ taglib uri="http://www.fusioncharts.com/jsp/core" prefix="fc" %>
<jsp:useBean id="chartData" class="com.fusioncharts.sampledata.BasicRenderData"/>
<fc:render chartId="${chartData.chartId}" swfFilename="${folderPath}${chartData.swfFilename}"
width="${chartData.width}" height="${chartData.height}" debugMode="false"
registerWithJS="false" xmlUrl="${chartData.url}" />
Code in the bean (com.fusioncharts.sampledata.BasicRenderData) :
protected String xml;
protected String chartId = "basicChart";
protected String URL = "Data/Data.xml";
protected String width = "600";
protected String height = "300";
protected String swfFilename = "Column3D.swf";
// followed by getter and setter methods for the fields
|